ng run project:server universal production not possible
See original GitHub issueVersions
Angular CLI: 6.0.0-rc.5
Node: 8.11.1
OS: darwin x64
Angular: 6.0.0-rc.5
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.5.7
@angular-devkit/build-angular 0.5.7
@angular-devkit/build-optimizer 0.5.7
@angular-devkit/core 0.5.7
@angular-devkit/schematics 0.5.7
@angular/cdk 6.0.0-rc.11
@angular/material 6.0.0-rc.11
@ngtools/json-schema 1.1.0
@ngtools/webpack 6.0.0-rc.5
@schematics/angular 0.5.7
@schematics/update 0.5.7
rxjs 6.0.0-uncanny-rc.7
typescript 2.7.2
webpack 4.5.0
Repro steps
ng build --prod && ng run client:server
This builds the app in production mode but the universal server app uses the dev environment rather than production
I probably just missing something in my config but not sure what.
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (6 by maintainers)
Top Results From Across the Web
Angular development build does not run while prod build does
to run angular universal app in dev mode you need to run this command: npm run dev:ssr. or: ng run project:serve-ssr.
Read more >Angular workspace configuration
Configures defaults for creating a Universal application with server-side rendering, using the ng run <project>:server command. architect/app-shell, Configures ...
Read more >Angular workspace configuration
The architect/server section configures defaults for creating a Universal app with server-side rendering, using the ng run <project>:server command.
Read more >Angular Universal: Complete Practical Guide
This post will be a complete practical guide for getting started with Angular Universal. We are going to go start with an existing...
Read more >Server-side Rendering using KoaJS and Angular Universal
Which simply means that you can run your Angular application not only the browser but on the ... "ng build --prod && ng...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is how I got it working:
I created a
configurations.production
object in myserver
object:And I have this in my
build
run-script:This made my server side app read the production environment.
and what about
--watch
? I think that it’s also should be available forng run
.