From 862f699477c1883e5eac17bb20d25c9381fcbbd1 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Tue, 11 Oct 2016 12:35:00 +0200 Subject: [PATCH] improve webpack config --- webpack.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index da66e2d..6680115 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,7 +26,11 @@ module.exports = { {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}, {test: /\.(png|jpg|jpeg|gif)$/, loader: 'url?limit=10000&name=images/[name].[ext]',}, {test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')}, - {test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, loader: 'file-loader'} + {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"}, + {test: /\.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"}, ] }, plugins: [ @@ -47,6 +51,7 @@ if (process.env.NODE_ENV === 'production') { module.exports.plugins = (module.exports.plugins || []).concat([ new webpack.optimize.DedupePlugin(), new webpack.optimize.OccurrenceOrderPlugin(), + new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.optimize.UglifyJsPlugin({ compress: { warnings: true