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

speeds up the loading of third-party libraries #70

Closed
FranckFreiburger opened this issue May 16, 2021 · 0 comments
Closed

speeds up the loading of third-party libraries #70

FranckFreiburger opened this issue May 16, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@FranckFreiburger
Copy link
Owner

FranckFreiburger commented May 16, 2021

Is your feature request related to a problem? Please describe.
Loading 3rd party libraries could be very long since vue3-sfc-loader is processing every dependencies through babel (for CJS transformation and dependencies static analysis).
For instance, babylon.max.js takes around 17s to load.

Describe the solution you'd like
The simplest solution is to give control to the caller about what to transpile and what to not transpile.
eg. do not transpile babylon

    const options = {
      ...
      async handleModule(type, getContentData, path, options) {

        if ( path.toString().endsWith('babylon.max.js') )
          return createCJSModule(type, await getContentData(false), options)

        return undefined;
      },
      ...

These libraries must be leaves of the whole dependency graph since no static analysis will be performed on them.
These libraries must already be CJS (or obviously UMD).

Additional context
see #50

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

No branches or pull requests

1 participant