Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitChunksPlugin shouldn't change entrypoint chunk name #10910

Closed

Conversation

yurynix
Copy link
Contributor

@yurynix yurynix commented May 18, 2020

Hello 馃憢

When using the maxSize option of SplitChunksPlugin, the entry point name is changed to include the hash.
Not sure if that was intended or not.
IMO, it's really important for entrypoints to retain a constant predictable name.

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
yes on a standalone project with multiple entrypoints and a maxSize limit.
A test case is included in this PR. I had to update the snapshot(s) (not 100% sure that's ok)

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@yurynix
Copy link
Contributor Author

yurynix commented Jun 4, 2020

Hello 馃憢
Any chance it can be merged? Or can you maybe suggest different approach? 馃檪

@@ -807,7 +807,7 @@ describe("Defaults", () => {
- "idHint": "vendors",
- "priority": -10,
- "reuseExistingChunk": true,
- "test": /[\\\\/]node_modules[\\\\/]/i,
- "test": /[\\\\\\/]node_modules[\\\\\\/]/i,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove changes from this tests, bug on old node

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yurynix
Copy link
Contributor Author

yurynix commented Jun 11, 2020

https://travis-ci.org/github/webpack/webpack/builds/696989436
Reported ok, but at github it looks hanged 馃檨

@yurynix yurynix force-pushed the entrypoint-chunk-name-shouldnt-change branch from 4ab765d to 75144cf Compare June 11, 2020 09:31
@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we鈥檒l review the pull request soon.

@sokra
Copy link
Member

sokra commented Jun 16, 2020

IMO, it's really important for entrypoints to retain a constant predictable name.

Why is it important? If you need it for inclusion in the HTML, I have to disappoint you. You need to include all splitted files into the HTML. So even the files with a hash.

@yurynix
Copy link
Contributor Author

yurynix commented Jun 16, 2020

I don't bundle for the browser (rather for the cloud, i.e. AWS Lambda), I bundle node code with multiple entry points, when I don't use the maxSize feature, all good (for me), the output code has exactly the same entry point names as were the input code.

When I do use maxSize, a hash is added to the output entry points filenames, which is kinda unexpected, why webpack has this inconsistency? Why in one flow it adds hash but not in the other? 馃檪

Could you elaborate on the benefits of having entry points names with hash?

@vankop
Copy link
Member

vankop commented Dec 4, 2021

Can not reproduce problem with latest webpack. Please create a new issue with repro if problem still exist.

@vankop vankop closed this Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants