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

vite optimize doesn't seem to actually be used with a subsequent vite #11005

Closed
7 tasks done
segevfiner opened this issue Nov 20, 2022 · 2 comments · Fixed by #11387
Closed
7 tasks done

vite optimize doesn't seem to actually be used with a subsequent vite #11005

segevfiner opened this issue Nov 20, 2022 · 2 comments · Fixed by #11387
Labels
contribution welcome p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@segevfiner
Copy link
Contributor

Describe the bug

Precompiling dependencies using vite optimize are not used by a subsequent vite dev server invocation.

Reproduction

https://stackblitz.com/edit/vitejs-vite-yydkbu?file=main.js

Steps to reproduce

  1. Run vite optimize in a project that has external dependencies.
  2. They will be generated into node_modules/.vite/deps_build-* instead of node_modules/.vite/deps, the manifest also has different hashes than the ones created from the Vite dev server.
  3. The cache created by vite optimize is not used by a subsequent vite.

System Info

System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 120.06 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
    npm: 9.1.1 - ~/.nvm/versions/node/v16.18.1/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Safari: 16.1
  npmPackages:
    @vitejs/plugin-vue: ^3.1.2 => 3.2.0
    vite: ^3.1.7 => 3.2.3

Used Package Manager

pnpm

Logs

No response

Validations

@bluwy bluwy added contribution welcome p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Dec 10, 2022
@github-actions
Copy link

Hello @segevfiner. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!

@bluwy
Copy link
Member

bluwy commented Dec 10, 2022

Looks like we need to make vite optimize prebundle for dev instead, or based on the optimizeDeps.disabled option.

patak-dev pushed a commit that referenced this issue Dec 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2023
futurGH pushed a commit to futurGH/vite that referenced this issue Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution welcome p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants