Permalink
Cannot retrieve contributors at this time
Integration-Examples/Angular/Example-Apps/angular2-webpack-boilerplate/webpack.common.js /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
49 lines (45 sloc)
1.02 KB
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
| const webpack = require("webpack"), | |
| path = require('path'); | |
| const ccpOptions = { | |
| name: 'vendor', | |
| filename: './dist/vendor.bundle.js' | |
| }; | |
| function root(__path) { | |
| return path.join(__dirname, __path); | |
| } | |
| module.exports = { | |
| entry: { | |
| "vendor": "./app/vendor", | |
| "app": "./app/main" | |
| }, | |
| output: { | |
| path: __dirname, | |
| filename: "./dist/[name].bundle.js" | |
| }, | |
| resolve: { | |
| extensions: ['.ts', '.js'], | |
| modules: [ | |
| path.resolve('./app'), | |
| 'node_modules' | |
| ] | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.ts/, | |
| loader: 'ts-loader', | |
| exclude: /node_modules/ | |
| } | |
| ] | |
| }, | |
| plugins: [ | |
| new webpack.optimize.CommonsChunkPlugin(ccpOptions), | |
| // Takes care of warnings described at https://github.com/angular/angular/issues/11580 | |
| new webpack.ContextReplacementPlugin( | |
| // The (\\|\/) piece accounts for path separators in *nix and Windows | |
| /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, | |
| root('./src'), // location of your src | |
| { } | |
| ) | |
| ] | |
| } |