-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
51 lines (40 loc) · 1.3 KB
/
webpack.config.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
// WEBPACK CONFIGURATION
// For instructions about this file refer to:
// http://webpack.github.io
var webpack = require('webpack')
// Development Settings
var settings = require('./settings')
module.exports = {
debug: true,
devtool: settings.development ? '#eval-source-map' : null,
context: __dirname,
entry: {
demo: settings.development ? ['webpack-hot-middleware/client?reload=true', './demo/demo'] : ['./demo/demo'],
typorhythm: settings.development ? ['webpack-hot-middleware/client?reload=true', './typorhythm/typorhythm'] : ['./typorhythm/typorhythm'],
},
output: {
path: __dirname,
filename: settings.development ? '[name].min.js' : '[name]/[name].min.js'
},
resolve: {
extensions: ['', '.js','.jsx']
},
plugins: settings.development ? [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
],
module: {
preLoaders: [
{ test: /\.(js|jsx)$/, exclude: /node_modules/, loader: 'eslint' }
],
loaders: [
// Scripts
{ test: /\.(js|jsx)$/, exclude: /node_modules/, loader: 'babel' }
]
}
}