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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chunkFileNames needs to be case sensitive #3139

Open
shirotech opened this issue Sep 29, 2019 · 4 comments
Open

chunkFileNames needs to be case sensitive #3139

shirotech opened this issue Sep 29, 2019 · 4 comments

Comments

@shirotech
Copy link

  • Rollup Version: 1.21.4
  • Operating System (or Browser): Mac
  • Node Version: v10.16.3

How Do We Reproduce?

config
chunkFileNames: '[name].js',

Expected Behavior

It is expected to generate name which is case sensitive.

Actual Behavior

It is generating Date.js and date.js the same as date.js and it confuses the bundle.

@lukastaegert
Copy link
Member

Not sure I understand you correctly. At the moment the names ARE case sensitive in that Date and date are different. You are meaning to say we should make it case-insensitive, i.e. if Date.js and date.js end up next to each other, we deconflict one of them?

@shirotech
Copy link
Author

No, I meant that for example Date.js and date.js gets combined to date.js for some reason, so currently, it is insensitive. We need it to make it sensitive for all cases. I'm not exactly sure what causes this case-insensitivity, but when I remove the option chunkFileNames it works fine.

@lukastaegert
Copy link
Member

As you are on a Mac, I would assume you are on a case-insensitive file system as this is the default. That means that when there is a file on the disk named date.js and you store a file named Date.js, then that will replace the existing file. My guess is that it is not Rollup that is replacing the file but your operating system. The reason is that Rollup is, as far as I know, case-sensitive, which means that it thinks date.js and Date.js are different file names and there is no reason to change one of the names before writing to disk (you could check by inspecting the bundle passed to the generateBundle hook if it has separate entries for the two files). The only people for whom this would be the correct choice, though, would be Linux users and some Mac users that specifically chose a case-sensitive file system, so case-insensitive deduplication by default would definitely be the prudent choice.

@yesmeck
Copy link
Contributor

yesmeck commented Jan 3, 2020

@lukastaegert Consider we have two virtual modules named \0date.js and \0Date.js, rollup treats these two modules are different, then writing them to _virtual/_date.js and _virtual/_Date.js, and on a case-insensitive OS,the later _virtual/_Date.js will override _virtual/_date.js.

I'm trying to fix this issue #3317, but don't know why CI are failed, could you have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants