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

A bug with packaging results affecting browser caching policies #4795

Open
meizilove258 opened this issue Jan 9, 2023 · 0 comments
Open

Comments

@meizilove258
Copy link

meizilove258 commented Jan 9, 2023

Rollup Version

"version": "3.9.1"

Operating System (or Browser)

browser

Node Version (if applicable)

v18.9.0

Link To Reproduction

https://github.com/meizilove258/vite-code-split2.git

Expected Behaviour

This is a vue project that uses vue and Vue-router. There are two pages for this project, about.vue and help.vue. Both about.vue and help.vue import useRoute and useRouter from the vue-router and use the two methods, respectively. In this project, vue and Vue-router are packaged into vendor.[contexthash].js. When the variable about.vue imported from the vute-router changed, it changed from useRoute and useRouter to useRoute. Changes in the vendor.[contexthash].js file were found during repackaging. The content found to change is the exported variable in vendor.[contexthash].js, among which the order of three variables has changed.
In my opinion, modification based on the above behavior should not happen. If no useRouter is imported into the entire application, tree-shake will occur at this time, resulting in changes in the vendor.[contexthash].js file is normal.

Actual Behaviour

This is a vue project that uses vue and Vue-router. There are two pages for this project, about.vue and help.vue. Both about.vue and help.vue import useRoute and useRouter from the vue-router and use the two methods, respectively. In this project, vue and Vue-router are packaged into vendor.[contexthash].js. When the variable about.vue imported from the vute-router changed, it changed from useRoute and useRouter to useRoute. Changes in the vendor.[contexthash].js file were found during repackaging. The content found to change is the exported variable in vendor.[contexthash].js, among which the order of three variables has changed.
In my opinion, modification based on the above behavior should not happen. If no useRouter is imported into the entire application, tree-shake will occur at this time, resulting in changes in the vendor.[contexthash].js file is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant