Browse Source

improve webpack config

pull/342/head
Guillaume Vincent 8 years ago
parent
commit
862f699477
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      webpack.config.js

+ 6
- 1
webpack.config.js View File

@@ -26,7 +26,11 @@ module.exports = {
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'}, {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
{test: /\.(png|jpg|jpeg|gif)$/, loader: 'url?limit=10000&name=images/[name].[ext]',}, {test: /\.(png|jpg|jpeg|gif)$/, loader: 'url?limit=10000&name=images/[name].[ext]',},
{test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')}, {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: [ plugins: [
@@ -47,6 +51,7 @@ if (process.env.NODE_ENV === 'production') {
module.exports.plugins = (module.exports.plugins || []).concat([ module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.optimize.DedupePlugin(), new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin(), new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { compress: {
warnings: true warnings: true


Loading…
Cancel
Save