I followed the angular universal guide (https://angular.io/guide/universal)
When I execute:
npm run build:universal
I got this error:
ERROR in ./server.ts Module not found: Error: Can't resolve './dist/server/main.bundle' in ... @ ./server.ts 16:9-45
npm run build:client-and-server-bundles
works fine but
npm run webpack:server
fails
Question: Is it normal, that no dist folder is created when I execute the command?
Need to change path inside file tsconfig.server.json
From
"files": [
"src/main.server.ts",
"server.ts"
],
TO
"files": [
"main.server.ts",
"../server.ts"
],
Other configuration should match with
https://github.com/angular/angular-cli/wiki/stories-universal-rendering
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With