Move project from SystemJS to Angular CLI / Webpack

后端 未结 2 1743
鱼传尺愫
鱼传尺愫 2021-01-12 17:36

I have a project which I have created using Angular 2 + SystemJS. Not I want to switch to Angular CLI + Webpack. Is there are recommended way to do it ?

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 18:30

    • Make Changes In package.json in scripts remove everything related to tsc and only keep replace it with build : webpack and start : webpack-dev-server.
    • In dev dependencies keep only typescript : version and ts-loader : version.
    • npm install
    • next change tsconfig.json module : commonjs.
    • add webpack.config.js .
    • npm run build
    • remove systemjs content from index.html -Include bundle.js in your index.html.

      -npm start

    Video Reference Here

    thats how you go from system.js to webpack for CLI i think installing CLI after this should work fine but I am not sure.

提交回复
热议问题