🐛 Résolution du bug de la compilation minifiée

pull/6/head
Mael Thomas 2017-03-27 13:42:10 +02:00
parent 092947a145
commit 0b412dac6d
2 changed files with 17 additions and 5 deletions

View File

@ -3,7 +3,8 @@
["env", {
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
}
},
"modules": false
}],
"react"
],

View File

@ -1,9 +1,13 @@
var webpack = require('webpack'),
autoprefixer = require('autoprefixer')
autoprefixer = require('autoprefixer'),
prodEnv = process.env.NODE_ENV == 'production' // eslint-disable-line no-undef
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
entry: prodEnv ? [
'babel-polyfill',
'./source/entry.js'
] : [
'webpack-dev-server/client?http://localhost:3000/',
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
@ -54,10 +58,17 @@ module.exports = {
loader: 'url-loader?limit=10000!img-loader?progressive=true'
}, {
test: /\.ne$/,
loader: 'nearley-loader'
loader: 'babel-loader!nearley-loader'
}]
},
plugins: [
plugins: prodEnv ? [
new webpack.NoEmitOnErrorsPlugin(),
// in order to use the fetch polyfill:
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
}),
new webpack.optimize.UglifyJsPlugin()
] : [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// in order to use the fetch polyfill: