This file contains 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
'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