0

i want deploy angular universal project in my domain virtual directory but issue is that when i deploy project it not load any css js(asssets) and inner pages

e.g domain.com/virtual directory but when open it not load its assets saying not found domain.com/css altough it has to be this domain.com/Virtual Direcory/css

David
  • 33,444
  • 11
  • 80
  • 118

1 Answers1

0

When you do the build, you can specify the --deploy-url option

ng build --deploy-url /virtualDirectory

This will add the specified prefix to the scripts

David
  • 33,444
  • 11
  • 80
  • 118
  • i build using this npm run build:ssr can you help me in this detail – Adeel Murtaza May 14 '20 at 08:49
  • And what does `npm run build:ssr` do? – David May 14 '20 at 08:49
  • and it can also use for domain.com/page – Adeel Murtaza May 14 '20 at 08:52
  • Open up you package.json, find the line that says `build:ssr`, and add the option I indicated above – David May 14 '20 at 08:58
  • npm run build:ssr --deploy-url /virtualDirectory i used this comand it given me this error ERROR in Entry module not found: Error: Can't resolve '/virtualDirectory' – Adeel Murtaza May 14 '20 at 09:03
  • in my package jsoon lines are this plz help how to amend "compile:server": "webpack --config webpack.server.config.js --progress --colors", "serve:ssr": "node dist/server", "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server", "build:client-and-server-bundles": "ng build --prod && ng run SampleData:server:production --bundleDependencies all" – Adeel Murtaza May 14 '20 at 09:05