简体   繁体   English

使用多个自定义 angular 构建器

[英]Using multiple custom angular builders

I have been using the ng-cli-hooks custom builder for quite some time to inject the CSP into the index.html file and generating a custom webpack config.很长一段时间以来,我一直在使用ng-cli-hooks自定义构建器将 CSP 注入 index.html 文件并生成自定义 webpack 配置。

Now I am looking into @ngx-env/builder to allow environment variables to be injected on build.现在我正在研究@ngx-env/builder以允许在构建时注入环境变量。

But how can I use two or more custom builders?但是我怎样才能使用两个或更多的自定义构建器呢? I guess there is no setting in angular.json , where I can simply add more than 1 builder, because my search about this has turned up nothing.我想angular.json中没有设置,我可以简单地添加多个构建器,因为我对此的搜索没有任何结果。

But would it be possible to create an own custom builder which then imports functionality from the 2 other builders?但是是否可以创建一个自己的自定义构建器,然后从其他 2 个构建器导入功能?

Thank you!谢谢!

I am still using ng-cli-hooks builder and incorporated the functionality of @ngx-env/builder into my custom webpack config.我仍在使用 ng-cli-hooks builder 并将 @ngx-env/builder 的功能合并到我的自定义 webpack 配置中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 依次运行 angular 自定义构建器 - Run angular custom builders in sequence Angular 使用@angular-builders/custom-webpack 将 v13 迁移到 v14 - Angular migration v13 to v14 using @angular-builders/custom-webpack 如何使用带有 angular-builder 的自定义 webpack 将整个目录复制到 dist/ 中? - How do I copy an entire directory into dist/ using custom webpack with angular-builders? 将自定义环境参数传递给@angular-builders/custom-webpack - Pass custom environment parameters to @angular-builders/custom-webpack Angular 项目在 scss 文件上使用 @angular-builders/custom-webpack 编译失败 - Angular Project fails compilation with @angular-builders/custom-webpack on scss files 在 Angular 中使用自定义指令上传多个文件 - Multiple file upload using custom directive in Angular 使用 Cloud Builders 社区映像安装 Node SASS 期间,Google Cloud Builder for Angular 失败 - Google Cloud Builder for Angular fails during Node SASS installation using Cloud Builders Community image Ionic And Angular 5表单构建器和组未读取值 - Ionic And Angular 5 form builders and groups is not reading values 角度 2 中的多个自定义验证 - Multiple custom validation in angular 2 错误:Package“@ionic/angular-toolkit”没有定义构建器 - Error: Package "@ionic/angular-toolkit" has no builders defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM