Angular-cli: Add option in angular-cli.json to change src directory of bundle

Created on 11 Feb 2017  路  4Comments  路  Source: angular/angular-cli

When you run ng build, it seems absurd to me that there is no option in angular-cli.json to specify the path of the JS bundles in the <script src="" /> of index.html.

Right now, they are generated as a relative path with no prefix, i.e. <script src="vendor.bundle.js" />, but this isn't very useful if you have a backend stack which is serving files from a different location, or you want more fine tuned control of your directory structure.

Consider adding a bundle-src-prefix option or similar to angular-cli.json that would prepend the JS bundle with a customizable path.

OS?

All

Versions.

All (including beta.30)

Most helpful comment

deployUrl is also available for use in angular-cli.json

All 4 comments

If all you want is to serve the app from /custom/path/, you can use the --base-href parameter and set it to that /custom/path/.

If you want control, separate folder etc, try the deploy-url parameter.

deployUrl is also available for use in angular-cli.json

Closing this as answered.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings