Created
April 29, 2017 11:13
-
-
Save abrhambas01/91f1bb9e6f1ee09f068afdd27893d907 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack') | |
var path = require('path') | |
module.exports = { | |
entry : "./src/app.js", | |
output : | |
{ | |
path : path.resolve(__dirname,'./dist/js'), | |
filename : 'bundle.js' | |
}, | |
module: | |
{ | |
rules:[ | |
{ | |
test: /\.css$/, | |
use : ['style-loader', 'css-loader'] | |
}, | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: "babel-loader" | |
}, | |
] | |
}, | |
plugins :[ new webpack.optimize.UglifyJsPlugin] | |
}; | |
if(process.env.NODE_ENV === 'production'){ | |
module.exports.plugins.push(new webpack.optimize.UglifyJsPlugin()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment