-
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
fix(@angular-devkit/build-angular): use a dash in bundle names #25877
Conversation
55ed9a0
to
2c82be4
Compare
I'm missing something in the PR, but I can't figure out what as I don't know these parts well enough... Do you have an insight? |
// The first part of the filename is the name of file (e.g., "polyfills" for "polyfills.7S5G3MDY.js") | ||
const name = basename(relativeFilePath).split('.', 1)[0]; | ||
// The first part of the filename is the name of file (e.g., "polyfills" for "polyfills-7S5G3MDY.js") | ||
const name = basename(relativeFilePath).split('-', 1)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is causing the problem as the extension is no longer removed. Also in the case using slice can cause problems for entrypoints name with a dashed Example material-styles.css
. I propose to you a regexp.
const name = basename(relativeFilePath).split('-', 1)[0]; | |
const name = basename(relativeFilePath).replace(/(?:-[\dA-Z]{8})?\.[a-z]{2,3}$/, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Alan, let's try that
7b6360c
to
00acb46
Compare
This updates the esbuild based builder to use a dash in bundles and media instead of a dot to be consistent with the chunks files `chunk-xxx.js`.
00acb46
to
2fe2a1c
Compare
I had to change a few tests, but CI is now green. Thanks for the help @alan-agius4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for this.
…e name This update the regexp to account for the change in angular#25877
…e name This update the regexp to account for the change in angular#25877 A filename that has the hash included will be `main.[hash]` in Webpack and `main-[hash]` when using esbuild.
…e name This update the regexp to account for the change in #25877 A filename that has the hash included will be `main.[hash]` in Webpack and `main-[hash]` when using esbuild.
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. |
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The files generated by the esbuild-based builder are named
main.xxx.js
,polyfills.xxx.js
but the chunks are namedchunk-xxx.js
What is the new behavior?
This updates the esbuild-based builder to use a dash in bundles and media instead of a dot to be consistent with the chunks files
chunk-xxx.js
.Does this PR introduce a breaking change?
Other information