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

Support tsconfig aliases in CSS @import #6816

Merged
merged 11 commits into from
Apr 13, 2023
Merged

Support tsconfig aliases in CSS @import #6816

merged 11 commits into from
Apr 13, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Apr 11, 2023

Changes

Fix #6551 (take 2)
Supersedes #6626

This PR refactors vite-plugin-config-alias, and adds a config.createResolver patch that would make this plugin apply to CSS @import too. Even though this is a bit hacky, it's the only way to make it work completely.

Testing

#6812 added tests that previously caused regressions.

This PR also adds more tests for dev and build, and runs on Windows too.

Docs

n/a. Import aliases in the docs should already implicitly apply for style @import too, so I don't think this needs to be explicitly documented.

@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2023

🦋 Changeset detected

Latest commit: d0dc54e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release labels Apr 11, 2023
@github-actions
Copy link
Contributor

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

@github-actions github-actions bot added the 🚨 action Modifies GitHub Actions label Apr 12, 2023
@github-actions github-actions bot removed the 🚨 action Modifies GitHub Actions label Apr 12, 2023
@bluwy bluwy marked this pull request as ready for review April 13, 2023 09:12
@Princesseuh
Copy link
Member

Princesseuh commented Apr 13, 2023

Is there a world in which using a plugin like https://github.com/aleclarson/vite-tsconfig-paths would reduce the amount of code we need to do ourselves and potentially reduce maintenance work here?

@bluwy
Copy link
Member Author

bluwy commented Apr 13, 2023

vite-tsconfig-paths actually has this issue too (aleclarson/vite-tsconfig-paths#41), but if it get fixed upstream, I think it makes sense to use the plugin. It's quite exhausting to maintain this 🥲

If the patch works in this PR, I can upstream the changes too.

Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Would love to see us use an upstream plugin for this in the future to reduce the maintenance burden though

@bluwy bluwy merged commit 8539eb1 into main Apr 13, 2023
14 checks passed
@bluwy bluwy deleted the plt-46-css-tsconfig-alias branch April 13, 2023 14:11
@astrobot-houston astrobot-houston mentioned this pull request Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Questions about style import of scss+svelte+astro
2 participants