Use webpack.NormalModuleReplacementPlugin to generate react-native bundle
This commit is contained in:
parent
dea4a05903
commit
074bb2d8d5
|
@ -1,9 +1,5 @@
|
|||
|
||||
/// #if target == 'native'
|
||||
import xml2js from 'react-native-xml2js';
|
||||
/// #else
|
||||
import xml2js from 'xml2js';
|
||||
/// #endif
|
||||
import xml2js from 'xml2js';
|
||||
|
||||
import { featureCollection } from '@turf/helpers';
|
||||
import area from '@turf/area';
|
||||
|
|
|
@ -3943,15 +3943,6 @@
|
|||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
|
||||
},
|
||||
"ifdef-loader": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ifdef-loader/-/ifdef-loader-2.1.5.tgz",
|
||||
"integrity": "sha512-GMUW5L8ZjsKRGABV3iXLdNFe2l7qFp9jeGYS55I6RNZLgQpicKxUfdH5oLDJ1cu+udb0hZiglwW6nX2kzgy86w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"loader-utils": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"import-local": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz",
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
"babel-polyfill": "^6.26.0",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"http-server": "^0.12.3",
|
||||
"ifdef-loader": "^2.1.5",
|
||||
"jest": "^26.6.3",
|
||||
"ts-loader": "^8.0.11",
|
||||
"typescript": "^4.1.2",
|
||||
|
|
|
@ -14,8 +14,7 @@ module.exports = [
|
|||
test: /\.(t|j)s$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{ loader: "ifdef-loader", options: { target: "node" } },
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
|
@ -35,13 +34,17 @@ module.exports = [
|
|||
test: /\.(t|j)s$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{ loader: "ifdef-loader", options: { target: "native" } },
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['*', '.ts', '.ts', '.js']
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/^xml2js$/, 'react-native-xml2js',
|
||||
),
|
||||
]
|
||||
},
|
||||
{
|
||||
entry: {
|
||||
|
@ -58,8 +61,7 @@ module.exports = [
|
|||
test: /\.(t|j)s$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{ loader: "ifdef-loader", options: { target: "browser" } },
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
|
|
Loading…
Reference in New Issue