-
Notifications
You must be signed in to change notification settings - Fork 11
/
webpack.config.js
46 lines (45 loc) · 1.05 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
var webpack = require('webpack')
module.exports = {
entry: './public/src/app.js',
output: {
filename: 'app.js',
path: './public/bundles',
publicPath: '/bundles/',
chunkFilename: '[id].[hash].app.js'
},
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}, {
test: /\.css$/,
loader: process.env.NODE_ENV === 'production' ? 'style-loader!css-loader?minimize' : 'style-loader!css-loader?-minimize'
}, {
test: /\.png$/,
loader: 'url-loader',
query: {
mimetype: 'image/png'
}
}, {
test: /\.json$/,
loader: 'json'
}]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js'
}
},
devtool: process.env.NODE_ENV === 'production' ? 'source-map' : 'eval',
plugins: process.env.NODE_ENV === 'production' ? [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.DedupePlugin()
] : []
}