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

Cache dynamic ids #2908

Merged
merged 1 commit into from Jun 9, 2019
Merged

Cache dynamic ids #2908

merged 1 commit into from Jun 9, 2019

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #2903

Description

As it turns out, id resolution is REALLY expensive and while the ids of static imports were cached between builds, the ids of dynamic imports were not cached. This is fixed now for statically resolvable dynamic imports. This should also speed up watch mode.

@manucorporat
Copy link
Contributor

out of curiosity, what is expensive about resolveId?

@lukastaegert lukastaegert merged commit 84bc002 into master Jun 9, 2019
@lukastaegert lukastaegert deleted the gh-2903-cache-dynamic-ids branch June 9, 2019 15:26
@lukastaegert
Copy link
Member Author

Now that is a good question. So it seems the expesive operation is calling path.resolve(...) in defaultPlugin.ts. I do not have the slightest idea what is going on here. path.resolve() will need process.cwd(). Maybe it will also do some symlink resolution and therefore a lot of file-system operations? Makes me wonder if at some point we should consider rolling our own. On the other hand, rollup-plugin-node-resolve is already pleasantly fast.

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

Successfully merging this pull request may close these issues.

Rollup cache seems to be ignored with dynamic imports
2 participants