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

Code splitting build uses local name instead of chunk name #2713

Closed
dnbkr opened this issue Feb 22, 2019 · 5 comments · Fixed by #2714
Closed

Code splitting build uses local name instead of chunk name #2713

dnbkr opened this issue Feb 22, 2019 · 5 comments · Fixed by #2714

Comments

@dnbkr
Copy link

dnbkr commented Feb 22, 2019

  • Rollup Version: 1.2.2
  • Operating System (or Browser): MacOS Mojave
  • Node Version: 11.1.0

How Do We Reproduce?

Dynamic imports (import('./path/to/module')) build using the path to your local module in src, instead of being replaced with the chunk-hash filename, if the index.js of the module you're importing only re-exports from other files.

Example of issue here: https://github.com/coffeedoughnuts/rollup-code-split-bug with more details and steps to reproduce in README

Expected Behavior

dynamic imports build to be import('./chunk-[hash].js')

Actual Behavior

dynamic imports are unchanged from source (import('./lib'))

@lukastaegert
Copy link
Member

It looks like it could be related to using rollup-plugin-node-resolve and importing the directory name instead of directory/index.js. This would definitely qualify for a bug but can you check if it works correctly if you change the import to await import('./lib/index.js')? If not, does it make a difference if you also remove the node-resolve plugin?

@lukastaegert
Copy link
Member

Belay that, I see I am wrong

@lukastaegert
Copy link
Member

Fix at #2714

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

Successfully merging a pull request may close this issue.

2 participants