-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.js
46 lines (45 loc) · 1.28 KB
/
webpack.production.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')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: {
app: './src/main.js'
},
output: {
path: './build',
publicPath: '/build/',
filename: 'bundle.js'
},
module: {
loaders: [
{ test: /\.vue$/, loader: 'vue' },
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
{ test: /\.(png|jpg)$/, loader: 'file' },
{ test: /\.(png|jpg)$/, loader: 'url?limit=10000'},
{ test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff' },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream' },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml' },
{ test: /\.css$/, loader: 'style-loader!css-loader' }
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new ExtractTextPlugin('[name].min.css', {
allChunks: true
})
],
vue: {
loaders: {
css: ExtractTextPlugin.extract('css')
}
}
}