forked from danrasmuson/site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.DLL.babel.js
44 lines (41 loc) · 1.09 KB
/
webpack.DLL.babel.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
/**
* Webpack config to generate DLL for faster dev flow
*/
const path = require('path')
const webpack = require('webpack')
const pkg = require('./package')
const outputPath = path.join(__dirname, pkg.dllPlugin.path)
const deps = Object.keys(pkg.dependencies)
const wrap = JSON.stringify
module.exports = {
context: process.cwd(),
entry: {
vendorPackages: deps
},
output: {
filename: '[name].dll.js',
path: outputPath,
library: '[name]',
},
plugins: [
new webpack.DllPlugin({
name: '[name]',
path: path.join(outputPath, '[name].json'),
}),
// new webpack.DefinePlugin({ "process.env": {
// NODE_ENV: wrap(
// true
// ? "production"
// : process.env.NODE_ENV
// ),
//
// PHENOMIC_USER_PATHNAME: wrap("/"),
// PHENOMIC_USER_URL: wrap("/"),
// PHENOMIC_NAME: wrap(pkg.name[0].toUpperCase() + pkg.name.slice(1)),
// PHENOMIC_VERSION: wrap(pkg.version),
// PHENOMIC_HOMEPAGE: wrap(pkg.homepage),
// PHENOMIC_REPOSITORY: wrap(pkg.repository),
// }
// }),
]
}