Created
July 13, 2016 06:38
-
-
Save degrammer/50eedf3ac0293dbe2a6c395328c4bcc4 to your computer and use it in GitHub Desktop.
angular - webpack.config
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
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
entry: { | |
app:'./app/src/app.js', | |
vendor: ['angular','angular-animate','angular-aria','angular-material'] | |
}, | |
output: { | |
filename: 'app/build/bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
loader: 'babel-loader', | |
exclude: /node_modules/, | |
query: { | |
presets: ['es2015'] | |
} | |
}, | |
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' }, // use ! to chain loaders | |
{ test: /\.css$/, loader: 'style-loader!css-loader' }, | |
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' } // inline base64 URLs for <=8k images, direct URLs for the rest | |
] | |
}, | |
plugins: [ | |
new webpack.optimize.CommonsChunkPlugin('vendor', './app/build/vendor.bundle.js'), | |
new webpack.optimize.UglifyJsPlugin({ mangle: false, compress: { warnings: false }}) | |
], | |
resolve: { | |
modulesDirectories: [ 'node_modules' ], | |
extensions: [ '', '.js', '.jsx' ], | |
alias: { | |
modules: path.resolve(__dirname, "app/src/modules") | |
} | |
}, | |
target: 'web' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment