Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize angular-cli build process

I am working on POC where we have to package angular dist folder in spring mvc based web application(single war). This will be deployed in weblogic and tomcat. War file will serve the static content which is angular 2 app.

Now what i noticed is that when angular-cli builds the app, it is updating index.html with "script" tag to point to generated "js" files. I want to customize this script tag so that i can add "context" name in the url.

Is this something can be done? Or If I have to use webpack, does webpack support this customization?

here is example of script tag i would like to add during angular-cli build process

<script type="text/javascript" src="<CONTEXT-NAME>/inline.bundle.js"></script>
like image 481
user509755 Avatar asked Aug 24 '26 02:08

user509755


1 Answers

@angular-builders/custom-webpack allows you to customize Angular build.
indexTransform option allows you to modify index.html (including script tags).

Disclaimer: I'm the owner of this project

like image 98
JeB Avatar answered Aug 25 '26 16:08

JeB