Created
January 14, 2017 23:42
-
-
Save robwormald/ef3e78fa44ff135ca34d754be44a7800 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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