-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
[Feature Request] Add support for moduleResolution: NodeNext in v3 #15885
Comments
Ideally, support it in v2 as well! A similar "exports" object would work for that as well. |
Note that adding the Another note: I have read in one of the TypeScript docs that the Also relevant upstream issue at TypeScript: microsoft/TypeScript#50058 |
Yeah we probably won't be adding it in v2 because even just |
Any news on this? Using bundler resolution in TS 5.0 as Evan You suggested for vite, results in |
Same problem here. In the vuetfiy/package.json I changed "./components": "./lib/components/index.mjs",
"./components/*": "./lib/components/*/index.mjs", to "./components": {
"types": "./lib/components/index.d.ts",
"default": "./lib/components/index.mjs"
},
"./components/*": {
"types": "./lib/components/*/index.d.ts",
"default": "./lib/components/*/index.mjs"
}, to get it temporarily working. edit: "pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}, diff --git a/package.json b/package.json
index 31fb911a1328c5b1a8121086f3ad31281c09bf1d..6d572d168f9c120474387dee9e26290a4a2db86a 100755
--- a/package.json
+++ b/package.json
@@ -54,25 +54,62 @@
".": {
"sass": "./lib/styles/main.sass",
"style": "./lib/styles/main.css",
- "default": "./lib/framework.mjs"
+ "default": "./lib/framework.mjs",
+ "types": "./lib/index.d.ts"
},
"./styles": {
"sass": "./lib/styles/main.sass",
"default": "./lib/styles/main.css"
},
"./styles/*": "./lib/styles/*",
- "./framework": "./lib/framework.mjs",
- "./blueprints": "./lib/blueprints/index.mjs",
- "./blueprints/*": "./lib/blueprints/*.mjs",
- "./components": "./lib/components/index.mjs",
- "./components/*": "./lib/components/*/index.mjs",
- "./directives": "./lib/directives/index.mjs",
- "./directives/*": "./lib/directives/*/*.mjs",
- "./locale": "./lib/locale/index.mjs",
- "./locale/adapters/*": "./lib/locale/adapters/*.mjs",
- "./iconsets/*": "./lib/iconsets/*.mjs",
- "./labs/components": "./lib/labs/components.mjs",
- "./labs/*": "./lib/labs/*/index.mjs",
+ "./framework": {
+ "types": "./lib/index.d.ts",
+ "default": "./lib/framework.mjs"
+ },
+ "./blueprints": {
+ "types": "./lib/blueprints/index.d.ts",
+ "default": "./lib/blueprints/index.mjs"
+ },
+ "./blueprints/*": {
+ "types": "./lib/blueprints/*.d.ts",
+ "default": "./lib/blueprints/*.mjs"
+ },
+ "./components": {
+ "types": "./lib/components/index.d.ts",
+ "default": "./lib/components/index.mjs"
+ },
+ "./components/*": {
+ "types": "./lib/components/*/index.d.ts",
+ "default": "./lib/components/*/index.mjs"
+ },
+ "./directives": {
+ "types": "./lib/directives/index.d.ts",
+ "default": "./lib/directives/index.mjs"
+ },
+ "./directives/*": {
+ "types": "./lib/directives/*/*.d.ts",
+ "default": "./lib/directives/*/*.mjs"
+ },
+ "./locale": {
+ "types": "./lib/locale/index.d.ts",
+ "default": "./lib/locale/index.mjs"
+ },
+ "./locale/adapters/*": {
+ "types": "./lib/locale/adapters/*.d.ts",
+ "default": "./lib/locale/adapters/*.mjs"
+ },
+ "./iconsets/*": {
+ "types": "./lib/iconsets/*.d.ts",
+ "default": "./lib/iconsets/*.mjs"
+ },
+ "./labs/components": {
+ "types": "./lib/labs/components.d.ts",
+ "default": "./lib/labs/components.mjs"
+ },
+ "./labs/*": {
+ "types": "./lib/labs/*.d.ts",
+ "default": "./lib/labs/*.mjs"
+ },
"./*": "./*"
},
"typesVersions": { |
closes #15885 BREAKING CHANGE: .d.ts imports have to be changed to .d.mts BREAKING CHANGE: minimum typescript version 4.7
Problem to solve
When using
moduleResolution: NodeNext
intsconfig.json
theexports
field is used for imports and types. Sopackage.json
must havetypes
fields in theexports
field. And the type definition files need to have .d.mts extension when using .mjs files.Proposed solution
Change the build to produce
.d.mts
definition files or change to.js
files instead of.mjs
. And changepackage.json
exports
to something like the following:The text was updated successfully, but these errors were encountered: