diff --git a/fixtures/gists-app/app/root.jsx b/fixtures/gists-app/app/root.jsx index 16aa6633c9f..77fe7396433 100644 --- a/fixtures/gists-app/app/root.jsx +++ b/fixtures/gists-app/app/root.jsx @@ -2,13 +2,14 @@ import { useEffect } from "react"; import { Links, Meta, Scripts, useRouteData, useMatches } from "remix"; import { Outlet, Link } from "react-router-dom"; +import normalizeHref from "@exampledev/new.css/new.css"; import stylesHref from "./styles/app.css"; export function links() { return [ { rel: "stylesheet", - href: "https://unpkg.com/@exampledev/new.css@1.1.3/new.css" + href: normalizeHref }, { rel: "stylesheet", href: stylesHref } ]; diff --git a/fixtures/gists-app/package.json b/fixtures/gists-app/package.json index 6e5d1b4f376..53e5fdff5df 100644 --- a/fixtures/gists-app/package.json +++ b/fixtures/gists-app/package.json @@ -12,6 +12,7 @@ "start": "node server.js" }, "dependencies": { + "@exampledev/new.css": "^1.1.3", "@mdx-js/react": "^1.6.22", "autoprefixer": "^10.2.4", "compression": "^1.7.4", diff --git a/packages/remix-dev/compiler.ts b/packages/remix-dev/compiler.ts index 9daeece4bb5..530a1caf646 100644 --- a/packages/remix-dev/compiler.ts +++ b/packages/remix-dev/compiler.ts @@ -338,6 +338,10 @@ async function createServerBuild( packageName ); } + + // allow importing css files for bundling / hashing from node_modules. + if (id.endsWith(".css")) return false; + return true; } diff --git a/packages/remix-dev/compiler/plugins/mdx.ts b/packages/remix-dev/compiler/plugins/mdx.ts index 46f858e1a29..fd19abf9425 100644 --- a/packages/remix-dev/compiler/plugins/mdx.ts +++ b/packages/remix-dev/compiler/plugins/mdx.ts @@ -44,6 +44,7 @@ export function mdxPlugin(config: RemixConfig): esbuild.Plugin { export const filename = ${JSON.stringify(path.basename(args.path))}; export const headers = typeof attributes !== "undefined" && attributes.headers; export const meta = typeof attributes !== "undefined" && attributes.meta; + export const links = undefined; `; let errors: esbuild.PartialMessage[] = [];