Skip to content

Instantly share code, notes, and snippets.

@abrhambas01
Created April 29, 2017 11:13
Show Gist options
  • Save abrhambas01/91f1bb9e6f1ee09f068afdd27893d907 to your computer and use it in GitHub Desktop.
Save abrhambas01/91f1bb9e6f1ee09f068afdd27893d907 to your computer and use it in GitHub Desktop.
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