@@ -11,6 +11,7 @@ var path = require('path');
11
11
var autoprefixer = require ( 'autoprefixer' ) ;
12
12
var webpack = require ( 'webpack' ) ;
13
13
var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
14
+ var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
14
15
15
16
var isInNodeModules = 'node_modules' ===
16
17
path . basename ( path . resolve ( path . join ( __dirname , '..' , '..' ) ) ) ;
@@ -22,7 +23,8 @@ module.exports = {
22
23
entry : './src/index.js' ,
23
24
output : {
24
25
path : path . resolve ( __dirname , relative , 'build' ) ,
25
- filename : '[name].[hash].js' ,
26
+ filename : '[name].[chunkhash].js' ,
27
+ chunkFilename : '[name].[chunkhash].chunk.js' ,
26
28
// TODO: this wouldn't work for e.g. GH Pages.
27
29
// Good news: we can infer it from package.json :-)
28
30
publicPath : '/'
@@ -49,7 +51,7 @@ module.exports = {
49
51
{
50
52
test : / \. c s s $ / ,
51
53
include : path . resolve ( __dirname , relative , 'src' ) ,
52
- loader : 'style! css!postcss'
54
+ loader : ExtractTextPlugin . extract ( 'style' , ' css!postcss')
53
55
} ,
54
56
{
55
57
test : / \. j s o n $ / ,
@@ -93,6 +95,7 @@ module.exports = {
93
95
} ) ,
94
96
new webpack . DefinePlugin ( { 'process.env.NODE_ENV' : '"production"' } ) ,
95
97
new webpack . optimize . OccurrenceOrderPlugin ( ) ,
98
+ new webpack . optimize . DedupePlugin ( ) ,
96
99
new webpack . optimize . UglifyJsPlugin ( {
97
100
compressor : {
98
101
screw_ie8 : true ,
@@ -105,6 +108,7 @@ module.exports = {
105
108
comments : false ,
106
109
screw_ie8 : true
107
110
}
108
- } )
111
+ } ) ,
112
+ new ExtractTextPlugin ( '[name].[contenthash].css' )
109
113
]
110
114
} ;
0 commit comments