In my sample Angular 2 SPA , I have used Webpack 2 module bundler in order
- Bundle all my js files
- Implement "Tree Shaking" to remove dead code and reduce bundle js file size
- and to implement Ahead-of-time compilation to reduce the bundle js file size further.
I was able to achive "1" and "2" by creating a webpack.config.js file , and below are the contents of this file
'use strict';
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: './src/main.js',
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: false
})
],
output: {
filename:'./src/bundle.js'
}
}
Now what is that I need to do further , so that Ahead-of-time compilation can also be achieved ?