-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.babel.js
41 lines (39 loc) · 1.01 KB
/
webpack.config.babel.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
41
// webpack.config.babel.js
const isProd = process.env.NODE_ENV === 'production';
export default {
entry: [
'./src/index.js',
],
output: {
filename: 'index.js',
path: `${__dirname}/dist/`,
publicPath: isProd ? `/` : `http://localhost:${WDS_PORT}/`,
libraryTarget: 'commonjs2',
},
module: {
rules: [
{ test: /\.(js|jsx)$/, use: 'babel-loader', exclude: /node_modules/ },
]
},
devtool: isProd ? false : 'source-map',
resolve: {
extensions: ['.js', '.jsx'],
alias: {
react: `${__dirname}/node_modules/react`,
},
},
externals: {
react: {
'commonjs': 'react',
'commonjs2': 'react',
'amd': 'react',
'root': 'React',
},
'pbplus-member-ui': {
'commonjs': 'pbplus-member-ui',
'commonjs2': 'pbplus-member-ui',
'amd': 'pbplus-member-ui',
'root': 'pbplus-member-ui',
},
}
};