forked from Semantic-Org/Semantic-UI-React
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.umd.config.js
46 lines (42 loc) · 989 Bytes
/
webpack.umd.config.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
const webpack = require('webpack')
const config = require('./config')
const pkg = require('./package.json')
const webpackConfig = require('./webpack.config.babel')
const { paths } = config
const webpackUMDConfig = {
target: 'web',
devtool: false,
entry: {
[pkg.name]: paths.src('umd.js'),
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
output: {
filename: '[name].min.js',
libraryTarget: 'umd',
library: 'semanticUIReact',
path: paths.dist('umd'),
publicPath: '/',
pathinfo: true,
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
unused: true,
dead_code: true,
warnings: false,
},
output: { comments: false },
}),
],
module: {
noParse: webpackConfig.module.noParse,
rules: webpackConfig.module.rules,
},
}
module.exports = webpackUMDConfig