-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.dll.js
More file actions
35 lines (30 loc) · 920 Bytes
/
webpack.dll.js
File metadata and controls
35 lines (30 loc) · 920 Bytes
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
const webpack = require('webpack')
const path = require('path')
const outputPath = path.resolve('dll')
module.exports = {
devtool: 'source-map',
entry: {
react_vendor: ['react', 'react-dom', 'react-router-dom']
// others: ['']
},
output: {
filename: '[name].dll.js',
path: outputPath,
// The name of the global variable which the library's
// require() function will be assigned to
library: '[name]'
},
plugins: [
new webpack.DllPlugin({
context: __dirname,
// The path to the manifest file which maps between
// modules included in a bundle and the internal IDs
// within that bundle
path: path.join(__dirname, 'dll/[name]_manifest.json'),
// The name of the global variable which the library's
// require function has been assigned to. This must match the
// output.library option above
name: '[name]'
})
]
}