-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebpack.config.dev.dll.js
73 lines (66 loc) · 2.19 KB
/
webpack.config.dev.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const path = require('path')
const webpack = require('webpack')
const consts = require('./webpack/constants')
const getConfig = require('./webpack/common-config').getConfig
const commonConfig = getConfig('dev')
const outputPath = path.join(__dirname, 'dist')
const pkg = require(path.resolve(process.cwd(), 'package.json'))
const vendorDependencyNames = Object.keys(pkg.dependencies)
module.exports = {
// cheap-module-eval-source-map, because we want original source, but we don't
// care about columns, which makes this devtool faster than eval-source-map.
// http://webpack.github.io/docs/configuration.html#devtool
devtool: 'eval',
target: 'web', // Make web variables accessible to webpack, e.g. window
// devtool: 'cheap-module-eval-source-map',
cache: true,
debug: true,
entry: {
//adding other deps for dev build to vendor chunk to speed up build
vendor: vendorDependencyNames
.concat([
path.join(consts.SRC_DIR, 'client/styles/bootstrap.scss'),
]),
},
output: {
filename: '[name].dll.js',
path: outputPath,
library: '[name]',
publicPath: '/dist'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development')
},
'__ENV' : {
'Prod': false,
'Dev': true
}
}),
new webpack.DllPlugin({
name: '[name]',
path: path.join(outputPath, '[name]-manifest.json'),
context: path.join(consts.SRC_DIR, 'client')
})
],
resolve: {
root: [
path.resolve(__dirname, 'src/client'),
path.resolve(__dirname, 'src/')
],
},
module: {
/* tells webpack to skip parsing following libraries
requires use of "import loader" for certain modules, based on https://github.com/christianalfoni/react-webpack-cookbook/issues/30
*/
loaders: commonConfig.module.loaders
},
//required to have proper rem to px calcualtion, default floating point precision is not enough
//since most browsers use 15, SASS only uses 5, this leads to calculated size in px like 38.0001px
sassLoader: {
precision: 15,
includePaths: [path.join(consts.SRC_DIR, 'client/styles')]
},
}