generated from gatewaydevs/styleguidist-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.prod.js
48 lines (47 loc) · 1.09 KB
/
webpack.prod.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
42
43
44
45
46
47
48
var path = require('path');
module.exports = {
entry: './src/index.js',
mode: 'production',
devtool: false,
performance: {
maxEntrypointSize: 1024000,
maxAssetSize: 1024000
},
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index.js',
library: 'index',
globalObject: "this",
libraryTarget: 'commonjs2'
},
externals: {
react: 'commonjs react',
'react-dom': 'commonjs react-dom',
},
module: {
rules: [
{
test: /\.js$/,
include: path.join(__dirname, 'src'),
exclude: path.join(__dirname, '/node_modules/'),
loader: 'babel-loader',
options: {
plugins: ['@babel/plugin-proposal-optional-chaining'],
},
}
]
},
resolve: {
// extensions: ['js', 'jsx', 'ts', 'tsx'],
alias: {
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@helpers': path.resolve(__dirname, 'src/helpers'),
}
},
node: {
child_process: 'empty',
fs: 'empty',
// "os": require.resolve("os-browserify/browser"),
// "stream": require.resolve("stream-browserify")
}
};