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

[rollup-plugin] Cache npm modules after first rollup execution #1162

Closed
muenzpraeger opened this issue Apr 7, 2019 · 0 comments · Fixed by #1183
Closed

[rollup-plugin] Cache npm modules after first rollup execution #1162

muenzpraeger opened this issue Apr 7, 2019 · 0 comments · Fixed by #1183

Comments

@muenzpraeger
Copy link

Is your feature request related to a problem? Please describe.
If npm modules are used that expose additional LWCs (like lwc-components-lightning) every rollup execution in watch mode runs an exhaustive search across all npm modules. While it's necessary for the initial launch this step could be optimized for subsequent runs.

Describe the solution you'd like
The module search in installed npm modules should happen only once, and then use a cache.

Possible solution
If rollup runs in watch mode the first run of @lwc/module-resolver should cache the search results (i. e. as node_modules/.cache/lwc-modules-resolved.json.

@pmdartus pmdartus changed the title [compiler] Cache npm modules after first rollup execution [rollup-plugin] Cache npm modules after first rollup execution Apr 8, 2019
diervo added a commit that referenced this issue Apr 19, 2019
For LWC mono repo, we went from 8 seconds to 500ms.
Still room for improvement.
Fixes #1162 (at least partially)
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