-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.prod.js
executable file
·35 lines (34 loc) · 1.07 KB
/
webpack.config.prod.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
const webpackBaseConfig = require('./webpack.config.base')
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const loaders = webpackBaseConfig.module.loaders
module.exports = Object.assign(webpackBaseConfig, {
entry: {
app: ['./app']
},
output: {
path: path.join(__dirname, 'assets'),
filename: 'index.js',
publicPath: '/assets/'
},
plugins: [
new webpack.DefinePlugin({'process.env.NODE_ENV': '"production"'}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin( { sourceMap: false, compressor: { warnings: false } } ),
new ExtractTextPlugin("index.css"),
new HtmlWebpackPlugin({
template: 'index.template',
filename: `../index.html`
})
],
module: {
loaders: loaders.concat([{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css!postcss'),
include: __dirname
}])
}
})