-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
101 lines (100 loc) · 2.91 KB
/
webpack.prod.js
File metadata and controls
101 lines (100 loc) · 2.91 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
const merge = require('webpack-merge');
const common = require('./webpack.common');
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = merge.smart(common, {
mode: 'production',
entry: {
'lib/react-jsonschema-form-material-theme.min': './src/index.js',
'lib/react-jsonschema-form-material-theme': './src/index.js'
},
plugins: [new CleanWebpackPlugin(['build'], { beforeEmit: true })],
resolve: {
alias: {
react: path.resolve(__dirname, './node_modules/react'),
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
'@material-ui/core': path.resolve(__dirname, './node_modules/@material-ui/core'),
'@material-ui/icons': path.resolve(__dirname, './node_modules/@material-ui/icons'),
'@material-ui/lab': path.resolve(__dirname, './node_modules/@material-ui/lab'),
'selfkey-ui': path.resolve(__dirname, './node_modules/selfkey-ui'),
'react-jsonschema-form': path.resolve(__dirname, './node_modules/react-jsonschema-form'),
'react-jsonschema-form/lib/util': path.resolve(__dirname, './node_modules/react-jsonschema-form/lib/util'),
ajv: path.resolve(__dirname, './node_modules/ajv'),
'prop-types': path.resolve(__dirname, './node_modules/prop-types'),
},
},
externals: [
{
react: {
commonjs: 'react',
commonjs2: 'react',
amd: 'React',
root: 'React',
},
'react-dom': {
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'ReactDOM',
root: 'ReactDOM',
},
'@material-ui/core': {
commonjs: '@material-ui/core',
commonjs2: '@material-ui/core',
amd: '@material-ui/core',
root: '@material-ui/core',
},
'@material-ui/icons': {
commonjs: '@material-ui/icons',
commonjs2: '@material-ui/icons',
amd: '@material-ui/icons',
root: '@material-ui/icons',
},
'@material-ui/lab': {
commonjs: '@material-ui/lab',
commonjs2: '@material-ui/lab',
amd: '@material-ui/lab',
root: '@material-ui/lab',
},
'selfkey-ui': {
commonjs: 'selfkey-ui',
commonjs2: 'selfkey-ui',
amd: 'selfkey-ui',
root: 'selfkey-ui',
},
'react-jsonschema-form': {
commonjs: 'react-jsonschema-form',
commonjs2: 'react-jsonschema-form',
amd: 'react-jsonschema-form',
root: 'react-jsonschema-form',
},
'react-jsonschema-form/lib/utils': {
commonjs: 'react-jsonschema-form/lib/utils',
commonjs2: 'react-jsonschema-form/lib/utils',
amd: 'react-jsonschema-form/lib/util',
root: 'react-jsonschema-form/lib/util',
},
ajv: {
commonjs: 'ajv',
commonjs2: 'ajv',
amd: 'ajv',
root: 'ajv',
},
'prop-types': {
commonjs: 'prop-types',
commonjs2: 'prop-types',
amd: 'PropTypes',
root: 'PropTypes',
},
}
],
optimization: {
minimize: true,
minimizer: [
new UglifyJsPlugin({
include: /\.min\.js$/,
}),
],
nodeEnv: 'production',
},
});