1 | var path = require('path');
|
2 | var webpack = require('webpack');
|
3 | var ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin');
|
4 |
|
5 |
|
6 | module.exports = {
|
7 | devtool: false,
|
8 | resolve: {
|
9 | extensions: ['.js', '.jsx'],
|
10 | },
|
11 | entry: {
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | vendor: [
|
20 | 'raf/polyfill',
|
21 | 'babel-polyfill',
|
22 | 'url-polyfill',
|
23 | 'es6-promise',
|
24 | 'react',
|
25 | 'react-dom',
|
26 | 'antd',
|
27 | 'redux',
|
28 | 'prop-types',
|
29 | 'react-redux',
|
30 | 'mk-rc-select',
|
31 | 'moment',
|
32 | 'md5',
|
33 | 'immutable',
|
34 | 'history',
|
35 | 'fastclick',
|
36 | 'classnames',
|
37 | 'omit.js',
|
38 | 'react-keydown',
|
39 | 'react-resizable',
|
40 | 'react-json-tree',
|
41 | 'react-viewer',
|
42 | 'whatwg-fetch',
|
43 | 'fixed-data-table-2'
|
44 | ]
|
45 | },
|
46 | output: {
|
47 | path: path.join(__dirname, 'vendor'),
|
48 | filename: '[name].dll.js',
|
49 | library: '[name]_[chunkhash:8]',
|
50 |
|
51 | },
|
52 | plugins: [
|
53 |
|
54 | new webpack.DefinePlugin({
|
55 | 'process.env': { 'NODE_ENV': JSON.stringify('production') },
|
56 | }),
|
57 | new webpack.ContextReplacementPlugin(
|
58 | /moment[\\/]locale$/i,
|
59 | /^\.\/zh-cn$/i,
|
60 | ),
|
61 |
|
62 | new webpack.DllPlugin({
|
63 | context: __dirname,
|
64 | name: '[name]_[chunkhash:8]',
|
65 | path: path.join(__dirname, 'vendor', '[name].manifest.json'),
|
66 | }),
|
67 | new ParallelUglifyPlugin({
|
68 | cacheDir: '.cache/',
|
69 | uglifyJS: {
|
70 | output: {
|
71 | comments: false
|
72 | },
|
73 | compress: {
|
74 | warnings: false
|
75 | }
|
76 | }
|
77 | }),
|
78 |
|
79 | ],
|
80 | }; |
\ | No newline at end of file |