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
@@ -20,11 +20,10 @@ This story will show you how to set up Universal bundling for an existing `@angu
20
20
21
21
Install `@angular/platform-server` into your project. Make sure you use the same version as the other `@angular` packages in your project.
22
22
23
-
> 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)
23
+
> 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.
201
224
202
225
> 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!
@@ -263,60 +286,36 @@ app.listen(PORT, () => {
263
286
});
264
287
```
265
288
266
-
## Step 5: Setup a webpack config to handle this Node server.ts file and serve your application!
289
+
## Step 5: Setup a TypeScript config to handle this Node server.ts file and serve your application!
267
290
268
291
Now that we have our Node Express server setup, we need to pack it and serve it!
269
292
270
-
Create a file named `webpack.server.config.js` at the ROOT of your application.
293
+
Create a file named `server.tsconfig.json` at the ROOT of your application.
271
294
272
295
> 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