Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariorodriguespt/67277a0af2830ba7d8deeea444e31914 to your computer and use it in GitHub Desktop.
Save mariorodriguespt/67277a0af2830ba7d8deeea444e31914 to your computer and use it in GitHub Desktop.
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