-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong file order in index.html when bundleName is used #13568
Comments
Hi, I was unable to replicate this.
Can you try to update to the latest version of This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? If the problem persists, please provide a reproduction good way to make a minimal repro is to create a new app via |
Hey @alan-agius4 thanks for the fast reply. I think the issue occurs only when you add a bundleName of When you run I have done a quick-fix on my side (via patch-package) in the |
Hi, thanks for the repo. The root cause is that the name chosen for the css bundle is conflicting with the default module for the |
The CLI should emit an error in the case a bundle name option conflicts with a built-in name. |
Or, as i mentioned. The cli could reorder the scripts array before it gets inserted into the index.html file. |
@matthiaskomarek, re-ordering alone won't solve all the issues as this might also effect bundle budgets and other webpack plugins that we use. |
… have been name the same Naming more than 1 bundle with the same name might cause undefined behavior. Fixes #13568
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
No
Description
When i use a
bundleName
like the following inside theangular.json
for thestyles
array. The order of scripts generated in the index.html are in the wrong order.angular.json
Order of scripts in
index.html
after runningng build
The Problem is, that the
main.js
get inserted before thescripts.js
and this will fail if you have some external dependency added viascripts.js
I have already digged into the implementation in
@angular-devkit/build-angular/src/angular-cli-files/plugins/index-html-webpack-plugin.js
and found out that the problem is the bundle namemain
which is added into thethis._options.entrypoints
array before thescripts
entrypoint is added.🔬 Minimal Reproduction
See example above
🌍 Your Environment
The text was updated successfully, but these errors were encountered: