Skip to content

Instantly share code, notes, and snippets.

@kaflan
Created March 16, 2016 12:19
Show Gist options
  • Save kaflan/3344038b9227bc55dfc2 to your computer and use it in GitHub Desktop.
Save kaflan/3344038b9227bc55dfc2 to your computer and use it in GitHub Desktop.
var path = require('path');
var webpack = require('webpack');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
const NODE_ENV = process.env.NODE_ENV || 'development';
module.exports = {
// context: __dirname + '/public/scripts/app',
entry: {
bundle: __dirname + '/public/scripts/app/index.js'
},
output: {
path: __dirname + '/public/scripts/dist',
filename: '[name].js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel'
}, {
test: /\.html$/,
loader: 'raw'
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}, {
test: /\.png$/,
loader: "url-loader?limit=100000"
}, {
test: /\.jpg$/,
loader: "file-loader"
}]
},
plugins: [
new ngAnnotatePlugin({
add: true,
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: true,
unsafe: true
}
})
],
watch: true,
watchOptions: {
aggregateTimeout: 100
},
devServer: {
contentBase: __dirname + '/public',
hot: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment