skypackjs / skypack-cdn

An issue tracker for the CDN
107 stars 5 forks source link

[exports] support for subpath patterns #249

Open TremayneChrist opened 2 years ago

TremayneChrist commented 2 years ago

Hi,

Can you confirm when subpath patterns will be supported?

{
  "exports": {
    "./features/*": "./src/features/*.js"
  }
}

It seems it partially works but sets the mode of the file to be 'raw', instead of 'imports', meaning it will not be loaded correctly.

matthewp commented 2 years ago

This should be working. It should only go to raw if you are importing a package that doesn't contain the export. If there's a particular package you are having trouble with I can check on it.

TremayneChrist commented 2 years ago

Hey @matthewp thanks for getting back so quickly. It's probably something we're doing wrong, but the docs and support around exports is pretty confusing.

We're wanting to support Webpack 4/5, Rollup and Skypack and are currently testing with this package. In the package.json we have fallbacks for older versions of imports and expect these to also work in skypack.

Here's an example import we expect to load. This works correctly in all bundlers.

Again, it's probably something we've missed. You're help would be greatly appreciated!

TremayneChrist commented 2 years ago

Hi @matthewp do you think this is an issue on our side, or, with skypack itself?