fix(exports): resolve imports with explicit *.js extension (#1927)

Fixes #1925

Importing using the explicit `.*js` extension will throw an error as these are not included in the package exports map. Normally, this would be acceptable if it's not part of the API.

However, the `optimizeImports` Carbon preprocessor rewrites certain imports (e.g., `breakpoints`) to the source `*.js` file.

```sh
Internal server error: Failed to resolve import "carbon-components-svelte/src/Breakpoint/breakpoints.js" from "src/App.svelte".
```
This commit is contained in:
metonym 2024-03-07 20:35:08 -08:00 committed by GitHub
commit 0405edee7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,10 @@
"types": "./types/*.svelte.d.ts",
"import": "./src/*.svelte"
},
"./src/*.js": {
"types": "./types/*.d.ts",
"import": "./src/*.js"
},
"./src/*": {
"types": "./types/*.d.ts",
"import": "./src/*.js"