You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/stories/universal-rendering.md
+47-48Lines changed: 47 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,10 @@ This story will show you how to set up Universal bundling for an existing `@angu
22
22
23
23
Install `@angular/platform-server` into your project. Make sure you use the same version as the other `@angular` packages in your project.
24
24
25
-
> You'll also need ts-loader (for your webpack build we'll show later) and @nguniversal/module-map-ngfactory-loader, as it's used to handle lazy-loading in the context of a server-render. (by loading the chunks right away)
25
+
> You'll also need @nguniversal/module-map-ngfactory-loader, as it's used to handle lazy-loading in the context of a server-render. (by loading the chunks right away)
Below we can see a TypeScript implementation of a -very- simple Express server to fire everything up.
203
226
204
227
> Note: This is a very bare bones Express application, and is just for demonstrations sake. In a real production environment, you'd want to make sure you have other authentication and security things setup here as well. This is just meant just to show the specific things needed that are relevant to Universal itself. The rest is up to you!
@@ -265,60 +288,36 @@ app.listen(PORT, () => {
265
288
});
266
289
```
267
290
268
-
## Step 5: Setup a webpack config to handle this Node server.ts file and serve your application!
291
+
## Step 5: Setup a TypeScript config to handle this Node server.ts file and serve your application!
269
292
270
293
Now that we have our Node Express server setup, we need to pack it and serve it!
271
294
272
-
Create a file named `webpack.server.config.js` at the ROOT of your application.
295
+
Create a file named `server.tsconfig.json` at the ROOT of your application.
273
296
274
297
> This file basically takes that server.ts file, and takes it and compiles it and every dependency it has into `dist/server.js`.
0 commit comments