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

多入口页面,optimizeDeps预加载的包缓存失效 #8526

Closed
7 tasks done
Miofly opened this issue Jun 10, 2022 · 2 comments
Closed
7 tasks done

多入口页面,optimizeDeps预加载的包缓存失效 #8526

Miofly opened this issue Jun 10, 2022 · 2 comments

Comments

@Miofly
Copy link

Miofly commented Jun 10, 2022

Describe the bug

如图所示,项目是多页面入口的,每次运行完成后在 .vitevue.jspinia 在 deps 中存在了,但是重新运行,预加载没有生效。这两个包又重新加载了。测试单页面没这个问题,示例的代码中在 includes 加入了 vue 所以每次运行只有 pinia
image

Reproduction

https://github.com/Miofly/vite-pages-issue

System Info

System:
    OS: macOS Mojave 10.14.6
    CPU: (6) x64 Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz
    Memory: 25.79 MB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.9.0 - /usr/local/opt/nvm/versions/node/v16.9.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.21.1 - /usr/local/opt/nvm/versions/node/v16.9.0/bin/npm
  Browsers:
    Chrome: 102.0.5005.61
    Firefox: 99.0.1
    Safari: 12.1.2
  npmPackages:
    vite: 2.9.10 => 2.9.10

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red
Copy link
Member

This was because your config changes every time.
If you comment out this, optimize cache will be used.
https://github.com/Miofly/vite-pages-issue/blob/06fb6f0e3c547f49be8f35d4ef89a4ab69e4f4fb/configs/vite/src/index.ts#L38

@Miofly
Copy link
Author

Miofly commented Jun 11, 2022

This was because your config changes every time. If you comment out this, optimize cache will be used. https://github.com/Miofly/vite-pages-issue/blob/06fb6f0e3c547f49be8f35d4ef89a4ab69e4f4fb/configs/vite/src/index.ts#L38

thanks

@Miofly Miofly closed this as completed Jun 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants