Skip to content

Commit

Permalink
fix(dev): disable Vanilla Extract if not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed May 8, 2023
1 parent d8bcdc1 commit a7422b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-snakes-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Only process .css.ts/js files with Vanilla Extract if `@vanilla-extract/css` is installed
7 changes: 7 additions & 0 deletions packages/remix-dev/compiler/plugins/vanillaExtract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ export function vanillaExtractPlugin(
return {
name: pluginName,
async setup(build) {
try {
require.resolve("@vanilla-extract/css");
} catch (_) {
// If Vanilla Extract isn't installed, skip this plugin.
return;
}

let root = config.appDirectory;

let postcssProcessor = await getPostcssProcessor({
Expand Down

0 comments on commit a7422b7

Please sign in to comment.