You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a public 'utils' directory in my project, structured like the figure, export all the methods in 'index.ts', so that they can be import in utils/index.ts, but that will cause all uitls in the development environment to be loaded.
example: import { isUndefined } from '@dzh/utils',I only import one of these methods, and all utils were imported
import { isUndefined } from '@dzh/utils/src/is';
Must be import to a specific directory to not be so.
So there is no good way to deal with this kind of problem in the development environment, in addition to utils there will be public hooks and so on。
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
I have a public 'utils' directory in my project, structured like the figure, export all the methods in 'index.ts', so that they can be import in utils/index.ts, but that will cause all uitls in the development environment to be loaded.
example:
import { isUndefined } from '@dzh/utils'
,I only import one of these methods, and all utils were importedimport { isUndefined } from '@dzh/utils/src/is';
Must be import to a specific directory to not be so.
So there is no good way to deal with this kind of problem in the development environment, in addition to utils there will be public hooks and so on。
Reproduction
https://github.com/Miofly/vite-dev-tree-shaking
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: