How to build angular 2 app without cli

后端 未结 2 1649
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 01:07

I am new in angular 2, I want to know how to build my angular 2 app without using CLI for production.

Thanks in Advance.

2条回答
  •  太阳男子
    2021-02-09 01:54

    If you have used CLI for your existing application You can migrate from Angular CLI to Webpack and tweak it accordingly for (local, development, production). Since Angular CLI v1.0 there’s the “eject” feature, that allows you to extract thewebpack config file and manipulate it as you wish.

    Run ng eject so Angular CLI generates the webpack.config.js file.
    Run npm install so the new dependencies generated by CLI are satisfied
    Refer this Angular CLI to webpack
    if you don't want to use CLI at all Refer This An Angular 2 Webpack setup for development and production and Webpack: An Introduction

提交回复
热议问题