Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path');
- const webpack = require('webpack');
- const helpers = require('./helpers');
- const HtmlWebpackPlugin = require('html-webpack-plugin');
- const AotPlugin = require('@ngtools/webpack').AotPlugin;
- const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
- module.exports = {
- entry: {
- polyfills: './app/polyfills.ts',
- vendor: './app/vendor-aot.ts',
- app: './app/boot-aot.ts'
- },
- output: {
- path: helpers.root('dist/aot'),
- publicPath: '/',
- filename: '[name].bundle.js',
- chunkFilename: '[id].chunk.js'
- },
- resolve: {
- extensions: ['.js', '.ts']
- },
- module: {
- loaders: [
- {
- test: /\.ts$/,
- loader: '@ngtools/webpack'
- },
- {
- test: /\.html$/,
- loader: 'html-loader'
- }
- ]
- },
- plugins: [
- new webpack.optimize.CommonsChunkPlugin({
- name: ['app', 'vendor', 'polyfills']
- }),
- // AOT Plugin
- new AotPlugin({
- tsConfigPath: './tsconfig.aot.json',
- entryModule: helpers.root('app/app.module#AppModule')
- }),
- new HtmlWebpackPlugin({
- template: 'config/index.html'
- }),
- new webpack.optimize.UglifyJsPlugin({
- beautify: false,
- comments: false,
- compress: {
- screw_ie8: true,
- warnings: false
- },
- mangle: {
- keep_fnames: true,
- screw_i8: true
- }
- }),
- new webpack.DefinePlugin({
- 'process.env': {
- 'ENV': JSON.stringify(ENV)
- }
- })
- ]
- };
Add Comment
Please, Sign In to add comment