docs: add universal guide (#18707)

- based on original effort in PR 17573

PR Close #18707
This commit is contained in:
Ward Bell
2017-08-15 10:22:55 -07:00
committed by Chuck Jazdzewski
parent 963a4d0dc8
commit 0b0d25fa33
36 changed files with 1200 additions and 336 deletions

View File

@ -0,0 +1,40 @@
const ngtools = require('@ngtools/webpack');
const webpack = require('webpack');
module.exports = {
devtool: 'source-map',
// #docregion entry
entry: {
main: [
'./src/universal/app-server.module.ts',
'./src/universal/server.ts'
]
},
// #enddocregion entry
resolve: {
extensions: ['.ts', '.js']
},
target: 'node',
// #docregion output
output: {
path: 'src/dist',
filename: 'server.js'
},
// #enddocregion output
// #docregion plugins
plugins: [
new ngtools.AotPlugin({
tsConfigPath: './tsconfig-universal.json'
})
],
// #enddocregion plugins
// #docregion rules
module: {
rules: [
{ test: /\.css$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.ts$/, loader: '@ngtools/webpack' }
]
}
// #enddocregion rules
}