Skip to content

Commit

Permalink
fix(dev): fix CSS import warnings in unstable_dev (#6506)
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish authored Jun 2, 2023
1 parent ce07e84 commit 9506d0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/css-import-warnings-unstable-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Fix warnings when importing CSS files with `future.unstable_dev` enabled
7 changes: 6 additions & 1 deletion packages/remix-dev/compiler/js/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { mdxPlugin } from "../plugins/mdx";
import { externalPlugin } from "../plugins/external";
import { cssBundleUpdatePlugin } from "./plugins/cssBundleUpdate";
import { cssModulesPlugin } from "../plugins/cssModuleImports";
import { cssSideEffectImportsPlugin } from "../plugins/cssSideEffectImports";
import {
cssSideEffectImportsPlugin,
isCssSideEffectImportPath,
} from "../plugins/cssSideEffectImports";
import { vanillaExtractPlugin } from "../plugins/vanillaExtract";
import invariant from "../../invariant";
import { hmrPlugin } from "./plugins/hmr";
Expand Down Expand Up @@ -150,6 +153,8 @@ const createEsbuildConfig = (
ctx.options.onWarning &&
!isNodeBuiltIn(packageName) &&
!/\bnode_modules\b/.test(args.importer) &&
!args.path.endsWith(".css") &&
!isCssSideEffectImportPath(args.path) &&
// Silence spurious warnings when using Yarn PnP. Yarn PnP doesn’t use
// a `node_modules` folder to keep its dependencies, so the above check
// will always fail.
Expand Down

0 comments on commit 9506d0f

Please sign in to comment.