-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.lib.js
executable file
·44 lines (39 loc) · 1.1 KB
/
webpack.lib.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
// webpack.lib.js
const webpack = require('webpack')
const path = require('path')
const NODE_ENV = process.env.NODE_ENV || 'production';
const isProductionMode = NODE_ENV === 'production';
console.log('================ webpack.lib.js ================');
console.log(`process.env.NODE_ENV: ${process.env.NODE_ENV}`)
console.log(`isProductionMode: ${isProductionMode}`);
console.log('================================================');
module.exports = {
mode: NODE_ENV,
entry: {
'lib': [
'react',
'react-dom',
'react-router-dom',
'react-dropzone',
'redux',
'react-redux',
'styled-components',
'@material-ui/core',
'@material-ui/icons',
],
},
output: {
filename: '[name].bundle.js',
path: path.join(__dirname, 'dist'),
library: '[name]_lib',
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, 'dist', '[name]-manifest.json'),
name: '[name]_lib'
}),
],
node: {
fs: 'empty'
}
}