[英]How to pass arguments to custom Angular webpack build?
I'm using Angular 7.2.1 and @angular-builders/custom-webpack:browser
for build of my application. 我正在使用Angular 7.2.1和
@angular-builders/custom-webpack:browser
来构建我的应用程序。 I want to pass some arguments to the webpack.config.js
file. 我想将一些参数传递给
webpack.config.js
文件。 When I am writing ng serve
or npm start
I'd like to add something like --env=testing
parameter and then have this value available in my webpack.config.js
. 当我编写
ng serve
或npm start
我想添加类似--env=testing
参数的内容,然后在我的webpack.config.js
提供此值。 How can I achieve that? 我怎样才能做到这一点?
它可以简单地通过这种方式传递:
ENV=testing npm run build
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.