-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.dll.js
46 lines (44 loc) · 1.23 KB
/
webpack.config.dll.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 {
createConfig, defineConstants, env, addPlugins,
entryPoint, setOutput, sourceMaps, webpack,
} = require('@webpack-blocks/webpack2')
const babel = require('@webpack-blocks/babel6')
const path = require('path')
const devServer = require('@webpack-blocks/dev-server2')
const cssModules = require('./tools/webpack-blocks/css-loader')
const DIST = `${__dirname}/static/dist`
module.exports = createConfig([
entryPoint({
vendor: [
'react', 'react-dom', 'redux', 'react-redux',
'redux-promise-middleware', 'redux-thunk',
'react-router', 'react-router-redux', 'react-router-dom',
'styled-components', 'polished',
'./src/vendor.js'],
}),
setOutput({
filename: '[name].dll.js',
path: DIST,
publicPath: '/static/dist',
library: '[name]', // needed for dll plugin
}),
cssModules(),
defineConstants({
'process.env.NODE_ENV': process.env.NODE_ENV,
}),
addPlugins([
new webpack.DllPlugin({
path: `${DIST}/[name]-manifest.json`,
name: '[name]',
context: __dirname,
}),
// cannot live with `-p` in command line
new webpack.optimize.UglifyJsPlugin({
minimize: true,
output: {
comments: false,
},
}),
]),
sourceMaps(),
])