diff --git a/browser/lib/transport/withoutjsonp.js b/browser/lib/transport/withoutjsonp.js new file mode 100644 index 0000000000..ee836375dc --- /dev/null +++ b/browser/lib/transport/withoutjsonp.js @@ -0,0 +1,10 @@ +/** + * This file exists for React Native and Nativescript in order to exclude the unsupported JSONP transport from these platforms. + */ +import XHRPollingTransport from './xhrpollingtransport'; +import XHRStreamingTransport from './xhrstreamingtransport'; + +export default [ + XHRPollingTransport, + XHRStreamingTransport +]; diff --git a/webpack.config.js b/webpack.config.js index 031bb4c647..4f46a5ae8d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -121,17 +121,9 @@ const nativeScriptConfig = { 'platform-crypto': path.resolve(browserPath, 'lib', 'util', 'crypto'), 'platform-webstorage': path.resolve(browserPath, 'lib', 'util', 'webstorage'), 'platform-msgpack': path.resolve(browserPath, 'lib', 'util', 'msgpack'), - 'platform-transports': path.resolve(browserPath, 'lib', 'transport'), + 'platform-transports': path.resolve(browserPath, 'lib', 'transport', 'withoutjsonp'), }, }, - module: { - rules: [ - { - test: /(jsonptransport\.js|domevent\.js)/, - use: 'null-loader', - }, - ], - }, node: { crypto: 'empty', Buffer: false, @@ -166,17 +158,9 @@ const reactNativeConfig = { 'platform-crypto': path.resolve(browserPath, 'lib', 'util', 'crypto'), 'platform-webstorage': path.resolve(browserPath, 'lib', 'util', 'webstorage'), 'platform-msgpack': path.resolve(browserPath, 'lib', 'util', 'msgpack'), - 'platform-transports': path.resolve(browserPath, 'lib', 'transport'), + 'platform-transports': path.resolve(browserPath, 'lib', 'transport', 'withoutjsonp'), }, }, - module: { - rules: [ - { - test: /jsonptransport\.js/, - use: 'null-loader', - }, - ], - }, node: { crypto: 'empty', Buffer: false, @@ -267,4 +251,4 @@ module.exports = [ noEncryptionMinConfig, commonJsConfig, commonJsNoEncryptionConfig, -]; \ No newline at end of file +];