Skip to content

Commit

Permalink
Normalize build configs
Browse files Browse the repository at this point in the history
  • Loading branch information
nkbt committed Apr 26, 2017
1 parent 72c20f9 commit 794ac20
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": [
["es2015", {"loose": true}],
"es2015",
"react"
],
"plugins": [
Expand All @@ -10,7 +10,7 @@
"env": {
"production": {
"plugins": [
["transform-react-remove-prop-types", { removeImport: true }]
["transform-react-remove-prop-types", {"removeImport": true}]
]
}
}
Expand Down
29 changes: 20 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,30 @@ const loaders = [
{
test: /\.js$/,
loader: 'babel-loader',
include: [path.resolve('src')]
include: [path.resolve('src')],
options: {
presets: [
['es2015', {modules: false}],
'react'
],
plugins: [
'transform-object-rest-spread',
'transform-class-properties'
],
env: {
production: {
plugins: [
['transform-react-remove-prop-types', {removeImport: true}]
]
}
}
}
}
];


const definePlugin = new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
});


Expand Down Expand Up @@ -113,11 +128,7 @@ const min = {
},
plugins: [
definePlugin,
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
new webpack.optimize.UglifyJsPlugin()
],
module: {loaders},
resolve,
Expand Down

0 comments on commit 794ac20

Please sign in to comment.