Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@scottaddie
Last active February 25, 2016 02:39
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 scottaddie/5d2fb53b4d64bd23f16f to your computer and use it in GitHub Desktop.
Save scottaddie/5d2fb53b4d64bd23f16f to your computer and use it in GitHub Desktop.
'use strict';
// import Webpack plugins
var cleanPlugin = require('clean-webpack-plugin');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
var webpack = require('webpack');
// define Webpack configuration object to be exported
var config = {
context: __dirname + '/app',
entry: './app.module.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
resolve: {
alias: {
'npm': __dirname + '/node_modules'
}
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style!css'
},
{
test: /\.(woff|woff2)$/,
loader: 'url?limit=10000&mimetype=application/font-woff'
},
{
test: /\.(eot|svg|ttf)$/,
loader: 'file'
},
{
test: /\.js?$/,
include: __dirname + '/app',
loader: 'babel'
}
],
preLoaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'jshint'
}
]
},
plugins: [
new cleanPlugin(['dist']),
new ngAnnotatePlugin({
add: true
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment