angular-builder

angular 7 build app - replace assets url with real url

試著忘記壹切 提交于 2021-01-29 05:21:12
问题 In an Angular 7 app i have different assets, images, fonts etc. All are located in src/assets/images or src/assets/fonts, etc I my files i use them like this: <img src="/assets/images/img.png"> angular.json look like this: ..... "assets": [ "src/favicon.ico", "src/assets" ] ..... When building I use: ng build --prod --build-optimizer --deploy-url=https://cdn.domain.com This will replace all the reference to assets resource from this: <img src="/assets/images/img.png"> to this: <img src="https

Angular CLI custom builder

假如想象 提交于 2020-02-18 12:42:35
问题 Angular CLI 6 introduced a new concept of builders (aka Architect Targets). There are a couple of prebuilt builders that come with @angular-devkit/build_angular, but unfortunately there is no documentation that explains how to create your own builder. How do I create my own builder (for example to modify the underlying webpack configuration)? 回答1: Update: For Angular 8+ read this AngularInDepth article. For Angular 6 and 7: The full article can be found here. For the sake of simplicity I

Angular CLI custom builder

一个人想着一个人 提交于 2020-02-18 12:38:51
问题 Angular CLI 6 introduced a new concept of builders (aka Architect Targets). There are a couple of prebuilt builders that come with @angular-devkit/build_angular, but unfortunately there is no documentation that explains how to create your own builder. How do I create my own builder (for example to modify the underlying webpack configuration)? 回答1: Update: For Angular 8+ read this AngularInDepth article. For Angular 6 and 7: The full article can be found here. For the sake of simplicity I