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

Dynamic import module build problem #6250

Closed
7 tasks done
sanyuan0704 opened this issue Dec 24, 2021 · 1 comment · Fixed by #6251 or #6534
Closed
7 tasks done

Dynamic import module build problem #6250

sanyuan0704 opened this issue Dec 24, 2021 · 1 comment · Fixed by #6251 or #6534
Labels
enhancement New feature or request

Comments

@sanyuan0704
Copy link
Contributor

sanyuan0704 commented Dec 24, 2021

Describe the bug

Dynamic import module cannot seperate source code and dependencies code after build.Inside vite, only the dependencies of non-dynamically imported modules will be packaged into the vendor. But for dynamically imported modules, their dependencies will be packaged with the application code, resulting in a decrease in the cache hit rate.

Reproduction

https://github.com/sanyuan0704/vite-dymaic-import-bundle-problem

image

System Info

System:
    OS: macOS 11.2
    CPU: (8) arm64 Apple M1
    Memory: 141.80 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 96.0.4664.110
    Safari: 14.0.3
  npmPackages:
    @vitejs/plugin-react: ^1.0.0 => 1.1.0 
    vite: ^2.7.6 => 2.7.6

Used Package Manager

pnpm

Logs

No response

Validations

@sanyuan0704 sanyuan0704 changed the title Dynamic import module cannot seperate source code and dependencies code after build Dynamic import module build problem Dec 24, 2021
@Shinigami92 Shinigami92 added enhancement New feature or request and removed pending triage labels Dec 26, 2021
@Shinigami92
Copy link
Member

Shinigami92 commented Dec 28, 2021

Reopening this, due to we revert the fix via #6290
We need another solution

See #6289

@Shinigami92 Shinigami92 reopened this Dec 28, 2021
@Niputi Niputi linked a pull request Dec 30, 2021 that will close this issue
9 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
2 participants