docs: add universal guide (#18707)
- based on original effort in PR 17573 PR Close #18707
This commit is contained in:

committed by
Chuck Jazdzewski

parent
963a4d0dc8
commit
0b0d25fa33
40
aio/content/examples/universal/webpack.config.universal.js
Normal file
40
aio/content/examples/universal/webpack.config.universal.js
Normal 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
|
||||
}
|
Reference in New Issue
Block a user