From 2ddfbf0a47a76f7012be03c12830d02c4b79fd99 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Tue, 13 Oct 2026 08:37:43 +0800 Subject: [PATCH] fix(resolve): update resolve.exports to 2.0.4 --- packages/vite/package.json | 2 +- playground/resolve/__tests__/resolve.spec.ts | 5 +++++ playground/resolve/imports-path/star/dollar$$.js | 1 + playground/resolve/index.html | 6 ++++++ pnpm-lock.yaml | 12 +++++++----- pnpm-workspace.yaml | 1 + 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 playground/resolve/imports-path/star/dollar$$.js diff --git a/packages/vite/package.json b/packages/vite/package.json index d880ef340179ce..2cdf3cc10fd17b 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -120,7 +120,7 @@ "postcss-load-config": "^6.0.1", "postcss-modules": "^9.0.1", "premove": "^4.0.0", - "resolve.exports": "^2.0.3", + "resolve.exports": "^2.0.4", "rolldown-plugin-dts": "^0.28.6", "rollup": "^4.59.0", "rollup-plugin-license": "^3.7.1", diff --git a/playground/resolve/__tests__/resolve.spec.ts b/playground/resolve/__tests__/resolve.spec.ts index 04c53cf7e9a070..72c4e6ad26e608 100644 --- a/playground/resolve/__tests__/resolve.spec.ts +++ b/playground/resolve/__tests__/resolve.spec.ts @@ -219,6 +219,11 @@ test('Resolving star with imports filed', async () => { expect(await page.textContent('.imports-star')).toMatch('[success]') }) +// https://github.com/vitejs/vite/issues/23637 +test('Resolving star with $$ in filename with imports field', async () => { + expect(await page.textContent('.imports-star-dollar')).toMatch('[success]') +}) + test('Resolving slash with imports filed', async () => { expect(await page.textContent('.imports-slash')).toMatch('[success]') }) diff --git a/playground/resolve/imports-path/star/dollar$$.js b/playground/resolve/imports-path/star/dollar$$.js new file mode 100644 index 00000000000000..b59a9e179b9d6a --- /dev/null +++ b/playground/resolve/imports-path/star/dollar$$.js @@ -0,0 +1 @@ +export const msg = '[success] star with $$ in filename' diff --git a/playground/resolve/index.html b/playground/resolve/index.html index 963eb8f4012a12..8679c7733703b9 100644 --- a/playground/resolve/index.html +++ b/playground/resolve/index.html @@ -55,6 +55,9 @@

Resolving nested path with imports field

Resolving star with imports filed

fail

+

Resolving star with $$ in filename with imports field

+

fail

+

Resolving slash with imports filed

fail

@@ -264,6 +267,9 @@

utf8-bom-package

import { msg as importsStar } from '#star/index.js' text('.imports-star', importsStar) + import { msg as importsStarDollar } from '#star/dollar$$.js' + text('.imports-star-dollar', importsStarDollar) + import { msg as importsSlash } from '#slash/index.js' text('.imports-slash', importsSlash) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39a166e634df1a..589574be4f77e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -535,8 +535,8 @@ importers: specifier: ^4.0.0 version: 4.0.0 resolve.exports: - specifier: ^2.0.3 - version: 2.0.3 + specifier: ^2.0.4 + version: 2.0.4 rolldown-plugin-dts: specifier: ^0.28.6 version: 0.28.6(@volar/typescript@2.4.28)(@vue/language-core@3.3.12)(rolldown@1.2.12)(typescript@6.0.3)(vue-tsc@3.3.12) @@ -773,6 +773,8 @@ importers: specifier: ^0.2.17 version: 0.2.17 + playground/base: {} + playground/base-conflict: {} playground/build-old: {} @@ -7334,8 +7336,8 @@ packages: resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve.exports@2.0.3: - resolution: {integrity: sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==} + resolve.exports@2.0.4: + resolution: {integrity: sha512-zepuGL0ulf+nt+XaFrlKeaiTJeyPFPLLY62+ncq1/VTHBdt3HsfXOH60priZ6tnXQozdGcDeIF5JVTanvIcYWQ==} engines: {node: '>=10'} resolve@1.22.11: @@ -13398,7 +13400,7 @@ snapshots: resolve-pkg-maps@1.0.0: {} - resolve.exports@2.0.3: {} + resolve.exports@2.0.4: {} resolve@1.22.11: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 89fa8e4a4c38b6..a1f0c86bb1cba0 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -64,6 +64,7 @@ minimumReleaseAgeExclude: - '@vitejs/devtools-*' - launch-editor-middleware@2.14.2 - launch-editor@2.14.2 + - resolve.exports@2.0.4 trustPolicy: no-downgrade trustPolicyExcludePrune: true trustPolicyExclude: