-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add vite resolve parameter to createViteServer (#1304)
Co-authored-by: Remus Mate <rmate@seek.com.au>
- Loading branch information
1 parent
f0c3be9
commit 545bf82
Showing
8 changed files
with
139 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
'@vanilla-extract/integration': minor | ||
--- | ||
|
||
Add a `viteResolve` option to the vite-node compiler | ||
|
||
This allows integrations to provide a Vite `resolve` config to the vite-node compiler, which will be used for resolving imports. These options include [`resolve.alias`], [`resolve.dedupe`], [`resolve.conditions`], [`resolve.mainFields`], [`resolve.extensions`], and others. | ||
|
||
[`resolve.alias`]: https://vitejs.dev/config/shared-options.html#resolve-alias | ||
[`resolve.dedupe`]: https://vitejs.dev/config/shared-options.html#resolve-dedupe | ||
[`resolve.conditions`]: https://vitejs.dev/config/shared-options.html#resolve-conditions | ||
[`resolve.mainFields`]: https://vitejs.dev/config/shared-options.html#resolve-mainfields | ||
[`resolve.extensions`]: https://vitejs.dev/config/shared-options.html#resolve-extensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
'@vanilla-extract/vite-plugin': patch | ||
--- | ||
|
||
Pass Vite `resolve` config to vite-node compiler | ||
|
||
The plugin passes through the project's Vite `resolve` config to the vite-node compiler, which will be used for resolving imports. These options include [`resolve.alias`], [`resolve.dedupe`], [`resolve.conditions`], [`resolve.mainFields`], [`resolve.extensions`], and others. | ||
|
||
[`resolve.alias`]: https://vitejs.dev/config/shared-options.html#resolve-alias | ||
[`resolve.dedupe`]: https://vitejs.dev/config/shared-options.html#resolve-dedupe | ||
[`resolve.conditions`]: https://vitejs.dev/config/shared-options.html#resolve-conditions | ||
[`resolve.mainFields`]: https://vitejs.dev/config/shared-options.html#resolve-mainfields | ||
[`resolve.extensions`]: https://vitejs.dev/config/shared-options.html#resolve-extensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
// @ts-expect-error aliased path | ||
import { border } from '@util/vars.css'; | ||
|
||
export const root = style({ | ||
vars: { | ||
[border]: '1px solid black', | ||
}, | ||
border, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
// @ts-expect-error virtual module | ||
import { color } from '~/vars'; | ||
|
||
export const root = style({ | ||
color, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { createVar } from '@vanilla-extract/css'; | ||
|
||
export const border = createVar(); |