-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.js
More file actions
56 lines (49 loc) · 1.7 KB
/
config.js
File metadata and controls
56 lines (49 loc) · 1.7 KB
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
47
48
49
50
51
52
53
54
55
56
const resolve = require('path').resolve
const pullAll = require('lodash/pullAll')
const uniq = require('lodash/uniq')
const ReactBoilerplate = {
// This refers to the react-boilerplate version this project is based on.
version: '3.4.0',
/**
* The DLL Plugin provides a dramatic speed increase to webpack build and hot module reloading
* by caching the module metadata for all of our npm dependencies. We enable it by default
* in development.
*
*
* To disable the DLL Plugin, set this value to false.
*/
dllPlugin: {
defaults: {
/**
* we need to exclude dependencies which are not intended for the browser
* by listing them here.
*/
exclude: [
'chalk',
'compression',
'cross-env',
'express',
'ip',
'minimist',
'sanitize.css',
],
/**
* Specify any additional dependencies here. We include core-js and lodash
* since a lot of our dependencies depend on them and they get picked up by webpack.
*/
include: ['core-js', 'eventsource-polyfill', 'babel-polyfill', 'lodash'],
// The path where the DLL manifest and bundle will get built
path: resolve('../node_modules/react-boilerplate-dlls'),
},
entry(pkg) {
const dependencyNames = Object.keys(pkg.dependencies)
const exclude = pkg.dllPlugin.exclude || ReactBoilerplate.dllPlugin.defaults.exclude
const include = pkg.dllPlugin.include || ReactBoilerplate.dllPlugin.defaults.include
const includeDependencies = uniq(dependencyNames.concat(include))
return {
reactBoilerplateDeps: pullAll(includeDependencies, exclude),
}
},
},
}
module.exports = ReactBoilerplate