Created
April 14, 2017 16:49
-
-
Save mariorodriguespt/67277a0af2830ba7d8deeea444e31914 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 debug = process.env.NODE_ENV !== 'production'; | |
var webpack = require('webpack'); | |
var HTMLWebpackPlugin = require('html-webpack-plugin'); | |
var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({ | |
template: __dirname + '/app/index.html', | |
filename: 'index.html', | |
inject: 'body' | |
}); | |
module.exports = { | |
context : __dirname, | |
devtool : debug ? 'inline-sourcemap' : '', | |
entry : [ | |
'./app/js/scripts.js' | |
], | |
output : { | |
path : __dirname + '/dist', | |
filename : 'index_bundle.min.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test : /\.coffee$/, | |
include : [ | |
__dirname + '/app' | |
], | |
loader : 'coffee-loader' | |
}, | |
{ | |
test: /\.js$/, | |
include : [ | |
__dirname + '/app' | |
], | |
loader: 'babel-loader' | |
} | |
] | |
}, | |
plugins: debug ? [] : [ | |
new webpack.optimize.OccurrenceOrderPlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
mangle: false, | |
sourcemap: false | |
}), | |
HTMLWebpackPluginConfig | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment