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

fix: make transformAssetUrl compatible with Node.js subpath imports patterns #13045

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haoqunjiang
Copy link
Member

Fixes #9919

The implementation is quite straightforward as shown in the first commit.
However I found the getImportsExpressionExp is getting more and more complex, so I refactored it to improve readability.
I can revert that commit if it presents a hurdle for merging this PR. But IMO, with so many existing test cases, the refactoring is quite safe.

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38.1 kB 34.3 kB
vue.global.prod.js 158 kB 58 kB 51.6 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.5 kB 18.2 kB 16.7 kB
createApp 54.5 kB 21.3 kB 19.5 kB
createSSRApp 58.7 kB 23 kB 21 kB
defineCustomElement 59.4 kB 22.9 kB 20.8 kB
overall 68.6 kB 26.4 kB 24 kB

Copy link

pkg-pr-new bot commented Mar 16, 2025

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@13045

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@13045

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@13045

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@13045

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@13045

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@13045

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@13045

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@13045

@vue/shared

npm i https://pkg.pr.new/@vue/shared@13045

vue

npm i https://pkg.pr.new/vue@13045

@vue/compat

npm i https://pkg.pr.new/@vue/compat@13045

commit: da82083

@haoqunjiang
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Mar 16, 2025

📝 Ran ecosystem CI: Open

suite result latest scheduled
nuxt success success
quasar success success
language-tools success success
radix-vue success success
primevue success success
test-utils success success
router success success
vite-plugin-vue success success
vueuse success success
vue-simple-compiler success success
vuetify success success
vitepress success success
vue-i18n success success
vue-macros success success
vant success success
pinia success success

@haoqunjiang haoqunjiang added ready for review This PR requires more reviews scope: sfc 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Mar 16, 2025
@edison1105
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready for review This PR requires more reviews scope: sfc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

src imports transformation does not support Node.js subpath imports-style URLs
3 participants