babel-plugin-transform-modules-commonjs lazy import transform #6155
airhorns
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
babel
and@swc/core
both support a really handy option for large projects: automatic lazy import transformation. If you depend on hundreds of modules, in development it is a lot faster to only require what is actually touched, instead of executing every require/import statement. Then, when a module is actually used the first time, say in a request handler, you can require it them, drastically improving boot/reload performance locally.Babel docs: https://babeljs.io/docs/babel-plugin-transform-modules-commonjs#lazy
SWC docs: https://swc.rs/docs/configuration/modules#lazy
We make heavy use of this in my project via https://www.npmjs.com/package/wds, and we were looking at porting
wds
over to useoxc
but noticed this one missing feature.PS:
oxc
is a really amazing project so far, thanks so much for all your hard work on it!Beta Was this translation helpful? Give feedback.
All reactions