const webpack =require("webpack")const helpers =require('./helpers')const path =require("path")const WebpackNotifierPlugin =require('webpack-notifier');
module.exports ={// set entry point for your app module"entry":{"app": helpers.root("app/main.module.ts"),},// output files to dist folder"output":{"filename":"[name].js","path": helpers.root("dist"),"publicPath":"/",},"resolve":{"extensions":['.ts','.js'],},"module":{"rules":[{"test":/\.ts$/,"loaders":[{"loader":'awesome-typescript-loader',"options":{"configFileName": helpers.root("./tsconfig.json")}},"angular2-template-loader"]},],},"plugins":[// notify when build is completenewWebpackNotifierPlugin({title:"build complete"}),// get reference for shimsnewwebpack.DllReferencePlugin({"context": helpers.root("src/app"),"manifest": helpers.root("config/polyfills-manifest.json")}),// get reference of vendor DLLnewwebpack.DllReferencePlugin({"context": helpers.root("src/app"),"manifest": helpers.root("config/vendor-manifest.json")}),// minify compiled jsnewwebpack.optimize.UglifyJsPlugin(),],}
vendor.config.js
const webpack =require("webpack")const helpers =require('./helpers')const path =require("path")
module.exports ={// specify vendor file where all vendors are imported"entry":{// optionally add your shims as well"polyfills":[helpers.root("src/app/shims.ts")],"vendor":[helpers.root("src/app/vendor.ts")],},// output vendor to dist"output":{"filename":"[name].js","path": helpers.root("dist"),"publicPath":"/","library":"[name]"},"resolve":{"extensions":['.ts','.js'],},"module":{"rules":[{"test":/\.ts$/,"loaders":[{"loader":'awesome-typescript-loader',"options":{"configFileName": helpers.root("./tsconfig.json")}},]},],},"plugins":[// create DLL for entriesnewwebpack.DllPlugin({"name":"[name]","context": helpers.root("src/app"),"path": helpers.root("config/[name]-manifest.json")}),// minify generated jsnewwebpack.optimize.UglifyJsPlugin(),],}