ng弹出的目的是什么

ng弹出的目的是什么

本文介绍了ng弹出的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档非常简短地介绍了这个主题:

The documentation is very brief with this topic:

ng eject 弹出你的应用并输出正确的 webpack 配置和脚本

这个命令的目的是什么?

What is the purpose of this command?

推荐答案

angular-cli 很神奇,一切都以简单且自动的方式完成.

angular-cli is something magic, everything is done in a simple and automatic way.

但有时,您可能想要对包的完成方式采取行动,添加插件,或者您只是想看看它所基于的 Webpack 配置.

But sometimes, you may want to act on how the package is done, add a plugin or you are simply curious to see the Webpack configuration on which it is based.

当运行 ng eject 时,你会生成一个 webpack.config.json 文件.查看文件 package.json,您将看到要启动的命令略有更改:

When running ng eject, you generate a webpack.config.json file. Looking at the file package.json you will see that the commands to launch have slightly changed:

ng serve --> npm start
ng build --> npm run build
ng e2e   --> npm run e2

如果你想撤销 ng弹出,你必须编辑你的.angular.cli.json文件并设置弹出为假:


If you want to undo ng eject, you will have to edit your .angular.cli.json file and set ejected to false:

"project": {
  ...
  "ejected": false
}

这篇关于ng弹出的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:07