Skip to content

Instantly share code, notes, and snippets.

@robwormald
Created January 14, 2017 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwormald/ef3e78fa44ff135ca34d754be44a7800 to your computer and use it in GitHub Desktop.
Save robwormald/ef3e78fa44ff135ca34d754be44a7800 to your computer and use it in GitHub Desktop.
const NgCompilerPlugin = require('@ngtools/webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: {
'admin-app': './src/admin/main.ts',
},
resolve: {
extensions: ['.ts', '.js'],
//mainFields: ["main", "module", "browser"],
alias: {
//'rxjs': path.resolve('node_modules/rxjs/src')
},
},
module: {
loaders: [
{
test: /\.ts$/,
loader: '@ngtools/webpack'
}
]
},
devtool: 'source-map',
output: {
filename: '[name].js',
chunkFilename: '[name].js',
path: 'public'
},
plugins: [
new NgCompilerPlugin.AotPlugin({
tsConfigPath: './tsconfig.json',
// mainPath: 'src/admin/main.ts',
entryModule: 'src/admin/admin-app#AdminAppModule'
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'ng-platform',
minChunks: 2
}),
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./public/angular_core-manifest.json'),
}),
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./public/angular_common-manifest.json'),
}),
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./public/angular_platform-manifest.json'),
}),
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./public/angular_router-manifest.json'),
}),
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./public/rxjs-manifest.json'),
}),
new HtmlWebpackPlugin({
title: 'ng app shell',
filename: 'index.html',
template: 'src/client/index.html'
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment