-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.haul.js
40 lines (39 loc) · 999 Bytes
/
webpack.haul.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const webpack = require('webpack');
module.exports = ({ platform }, defaults) => ({
entry: `./index.${platform}.js`,
module: {
...defaults.module,
rules: [
...defaults.module.rules,
{
test: /\.js$/,
loader: 'babel-loader',
include: [
/node_modules\/native-base-shoutem-theme/,
/node_modules\/@shoutem/,
/node_modules\/react-native-vector-icons/,
],
options: {
presets: ['react-native'],
},
},
{
test: /\.(otf|eot|svg|ttf|woff|woff2)$/,
loader: 'file-loader',
},
],
},
resolve: {
...defaults.resolve,
plugins: [
...defaults.resolve.plugins,
// Always expose NODE_ENV to webpack, in order to use `process.env.NODE_ENV`
// inside your code for any environment checks;
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
},
}),
],
},
});