forked from uxcore/uxcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.conf.js
40 lines (39 loc) · 983 Bytes
/
webpack.conf.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
var webpack = require('webpack');
var path = require('path');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
module.exports = {
cache: false,
entry: {
index: './index',
},
output: {
path: path.join(process.cwd(), './build'),
filename: 'uxcore.js',
library: 'Uxcore',
libraryTarget: 'umd',
},
module: {},
externals: {
react: {
root: 'React',
var: 'React',
commonjs: 'react',
commonjs2: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
var: 'ReactDOM',
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'react-dom',
},
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /zh|en/),
new DuplicatePackageCheckerPlugin(),
// new BundleAnalyzerPlugin(),
],
};