npm run build:ssr does not work in angular 8

后端 未结 3 2087
旧时难觅i
旧时难觅i 2021-02-20 18:12

I use angular 8 and server-side-rendering but i got error when i run npm run build:ssr As you can see, src is repeated twice home/app/front/**src

相关标签:
3条回答
  • 2021-02-20 18:25

    I had the same error. This is how i solved it:

    In src/tsconfig.server.json

    Change src/main.server.ts to main.server.ts

    0 讨论(0)
  • 2021-02-20 18:29

    In file src/tsconfig.server.json (generated by ng add @nguniversal/express-engine --clientProject myProject ) I changed

    "files": [ "src/main.server.ts", "server.ts" ],

    into

    "files": [ "main.server.ts", "../server.ts" ],

    After that npm run build:ssr works fine.

    0 讨论(0)
  • 2021-02-20 18:30
    ng add @nguniversal/express-engine
    

    run this command from inside your application folder

    0 讨论(0)
提交回复
热议问题