-
Notifications
You must be signed in to change notification settings - Fork 16
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
Simplified vite config #396
Conversation
vite.config.js
Outdated
(id.startsWith('@') && | ||
excluded.includes(id.split('/').slice(0, 2).join('/'))) | ||
// direct node_modules import | ||
id.includes('node_modules') || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id.includes('node_modules') || | |
id.includes('/node_modules/') || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 👍
vite.config.js
Outdated
// relative import is ok | ||
id.startsWith('.') || | ||
// absolute import is ok | ||
id.startsWith('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolute import is something that should never happen, actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(but maybe paths are transformed to absolute, I don't remember)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some ids are actually absolute paths for some reason, here is data sample
styled-components
./PopoverRoot
styled-components
../button
./PaginationItemStyles
./types
./PopoverRoot
../button
/Users/kozlovzxc/Projects/ui/packages/pagination/PaginationItemStyles.tsx
/Users/kozlovzxc/Projects/ui/packages/pagination/types.ts
/Users/kozlovzxc/Projects/ui/packages/popover/PopoverRoot.tsx
/Users/kozlovzxc/Projects/ui/packages/button/index.ts
Description
Looks like with
preserveModules: true
resolution works a bit differently, so it's not needed to write complexexternal
function.Demo