我正在尝试从 Angular 7 应用程序的 html 文件中删除不必要的 Cypress 属性。
我找到了这个 SOLUTION
所以我添加到我的angular.json
:
"build": {
"builder": "angular-cli-builders:custom-webpack-browser",
"options": {
"customWebpackConfig": {
"path": "./webpack/webpack.extra.js",
"mergeStrategies": {
"externals": "append"
}
},
当我使用 ng build
时,属性会被删除,但是当我使用 ng build --prod
时,属性不会被删除,为什么?
我也想在这里添加它,没有成功:
"configurations": {
"production": {
"customWebpackConfig": { [...]
最佳答案
@angular-builders/custom-webpack
根据您的构建(通用、开发等)有四个选项。一旦你阅读 these simple instructions 这实际上很容易.
关于angular - customWebpackConfig 在 Angular 中的 ng build --prod 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55358019/