angular/aio/content/examples/universal/webpack.config.client.js
Ward Bell 555b1cdf29 docs: add universal guide with production client app (#18707)
Revises both universal and client build to use AOT and webpack for both.
Guide text adjusted accordingly
Dodges CLI client build, expected in near future.

PR Close #18707
2017-10-09 14:46:04 -07:00

35 lines
706 B
JavaScript

// #docregion
const ngtools = require('@ngtools/webpack');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
devtool: 'source-map',
entry: {
main: [ './src/main.ts' ]
},
resolve: {
extensions: ['.ts', '.js']
},
output: {
path: 'dist',
filename: 'client.js'
},
plugins: [
// compile with AOT
new ngtools.AotPlugin({
tsConfigPath: './tsconfig.client.json'
}),
// minify
new UglifyJSPlugin()
],
module: {
rules: [
{ test: /\.css$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.ts$/, loader: '@ngtools/webpack' }
]
}
}