-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·48 lines (45 loc) · 1.27 KB
/
Copy pathwebpack.config.js
File metadata and controls
executable file
·48 lines (45 loc) · 1.27 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
var argv = require('yargs').argv
var path = require('path')
var webpack = require('webpack')
var CommonsChunkPlugin = require(__dirname + '/node_modules/webpack/lib/optimize/CommonsChunkPlugin')
// Create plugins array
const plugins = [
new CommonsChunkPlugin('commons.js')
]
// Add Uglify task to plugins array if there is a production flag
if (argv.production) {
plugins.push(new webpack.optimize.UglifyJsPlugin())
}
module.exports = {
entry: {
home: __dirname + '/src/js/app-home',
blog: __dirname + '/src/js/app-blog',
pledgeYourSupport: __dirname + '/src/js/app-pledgeYourSupport',
viewYourPledge: __dirname + '/src/js/app-viewYourPledge',
joinActionGroup: __dirname + '/src/js/app-joinActionGroup',
progress: __dirname + '/src/js/app-latestNews',
actionGroups: __dirname + '/src/js/app-actionGroups'
},
output: {
path: path.join(__dirname, '/_dist/assets/js/'),
filename: '[name].bundle.js',
chunkFilename: '[id].chunk.js',
publicPath: 'assets/js/'
},
plugins: plugins,
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015']
}
}
]
},
standard: {
parser: 'babel-eslint'
}
}