Skip to content

fix(css): fix lightningcss dep url resolution with custom root#18125

Merged
sapphi-red merged 9 commits intovitejs:mainfrom
hi-ogawa:fix-lightningcss-dep-url-replace
Sep 26, 2024
Merged

fix(css): fix lightningcss dep url resolution with custom root#18125
sapphi-red merged 9 commits intovitejs:mainfrom
hi-ogawa:fix-lightningcss-dep-url-replace

Conversation

@hi-ogawa
Copy link
Copy Markdown
Contributor

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@hi-ogawa hi-ogawa marked this pull request as ready for review September 17, 2024 04:25
@sapphi-red
Copy link
Copy Markdown
Member

I pushed a commit that renames root dir to dir dir because root dir has a special meaning and the test wasn't actually testing the issue.

// when `root` dir is present, use it as vite's root
const testCustomRoot = path.resolve(testDir, 'root')
rootDir = fs.existsSync(testCustomRoot) ? testCustomRoot : testDir

@sapphi-red sapphi-red added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release labels Sep 17, 2024
sapphi-red
sapphi-red previously approved these changes Sep 17, 2024
@sapphi-red
Copy link
Copy Markdown
Member

Sorry, I think I just mixed things up. The first code was correct. 😅

@hi-ogawa
Copy link
Copy Markdown
Contributor Author

I pushed a commit that renames root dir to dir dir because root dir has a special meaning and the test wasn't actually testing the issue.

Aha, I didn't notice that. I initially used playground/css-lightningcss/root with a separate config vite.config-root.ts dceaaf3 , but things got broken, so I just moved it off to a separate playground css-lightningcss-root.

@sapphi-red sapphi-red merged commit eb08f60 into vitejs:main Sep 26, 2024
@hi-ogawa hi-ogawa deleted the fix-lightningcss-dep-url-replace branch September 30, 2024 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: css p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relative CSS asset import does not work with root config set

3 participants