Skip to content

Commit c0a299a

Browse files
committed
Fix Remix Tailwind runtime matrix build
1 parent 799bf01 commit c0a299a

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The format follows Keep a Changelog and the version numbers follow Semantic Vers
2323
### Fixed
2424

2525
- Fixed Remix scaffolds to include the CLI/dev dependencies required for `npm run dev`, `pnpm run dev`, `yarn dev`, and `bun run dev` style workflows.
26+
- Fixed Tailwind-enabled Remix scaffolds to use the Vite Tailwind integration path instead of the PostCSS-only setup, which resolves the Bun production-build failure in the runtime matrix.
2627
- Fixed strict ESLint scaffolds so typed rules no longer run against config files such as `eslint.config.js`.
2728
- Stopped offering invalid combinations such as microfrontend architecture outside the microfrontend intent, NestJS with JavaScript, RTK Query without compatible Redux state, and ORMs when no database is selected.
2829

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Track what changed in DevForge CLI across releases, including scaffolding behavi
2626
### Fixed
2727

2828
- Fixed Remix scaffolds to include the CLI/dev dependencies required for `npm run dev`, `pnpm run dev`, `yarn dev`, and `bun run dev` style workflows.
29+
- Fixed Tailwind-enabled Remix scaffolds to use the Vite Tailwind integration path instead of the PostCSS-only setup, which resolves the Bun production-build failure in the runtime matrix.
2930
- Fixed strict ESLint scaffolds so typed rules no longer run against config files such as `eslint.config.js`.
3031
- Stopped offering invalid combinations such as microfrontend architecture outside the microfrontend intent, NestJS with JavaScript, RTK Query without compatible Redux state, and ORMs when no database is selected.
3132

src/templates.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ function collectDependencies(plan: ProjectPlan): {
890890
}
891891

892892
if (plan.frontend.styling === "tailwind-css") {
893-
if (["react-vite", "vue-vite", "svelte", "solidjs"].includes(plan.frontend.framework)) {
893+
if (["react-vite", "vue-vite", "svelte", "solidjs", "remix"].includes(plan.frontend.framework)) {
894894
addRecord(devDependencies, {
895895
"@tailwindcss/vite": "latest",
896896
tailwindcss: "latest",
@@ -1485,7 +1485,7 @@ function tailwindSupportFiles(plan: ProjectPlan): GeneratedFile[] {
14851485
return [];
14861486
}
14871487

1488-
if (["react-vite", "vue-vite", "svelte", "solidjs"].includes(plan.frontend.framework)) {
1488+
if (["react-vite", "vue-vite", "svelte", "solidjs", "remix"].includes(plan.frontend.framework)) {
14891489
return [];
14901490
}
14911491

@@ -2190,6 +2190,7 @@ function remixSource(plan: ProjectPlan, context?: FrontendSurfaceContext): Gener
21902190
const surface = frontendSurfaceDetails(plan, context);
21912191
const stylesheetPath =
21922192
plan.frontend?.styling === "scss" ? "./styles.scss?url" : "./styles.css?url";
2193+
const pluginLines = ["remix()", "tsconfigPaths()", ...(plan.frontend?.styling === "tailwind-css" ? ["tailwindcss()"] : [])];
21932194
return [
21942195
makeFile(
21952196
"app/root.tsx",
@@ -2296,9 +2297,10 @@ function remixSource(plan: ProjectPlan, context?: FrontendSurfaceContext): Gener
22962297
'import { vitePlugin as remix } from "@remix-run/dev";',
22972298
'import { defineConfig } from "vite";',
22982299
'import tsconfigPaths from "vite-tsconfig-paths";',
2300+
...viteTailwindPluginImportLines(plan),
22992301
"",
23002302
"export default defineConfig({",
2301-
" plugins: [remix(), tsconfigPaths()],",
2303+
vitePluginExpression(pluginLines),
23022304
"});",
23032305
"",
23042306
].join("\n"),

test/generator.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ test("remix bun scaffolds include runtime guidance, CLI dependencies, and typed-
283283
const viteConfigFile = files.find((file) => file.path === "vite.config.ts");
284284
const entryClientFile = files.find((file) => file.path === "app/entry.client.tsx");
285285
const entryServerFile = files.find((file) => file.path === "app/entry.server.tsx");
286+
const postcssConfigFile = files.find((file) => file.path === "postcss.config.mjs");
286287

287288
assert.ok(packageJsonFile);
288289
assert.ok(readmeFile);
@@ -292,6 +293,7 @@ test("remix bun scaffolds include runtime guidance, CLI dependencies, and typed-
292293
assert.ok(viteConfigFile);
293294
assert.ok(entryClientFile);
294295
assert.ok(entryServerFile);
296+
assert.equal(postcssConfigFile, undefined);
295297

296298
const packageJson = JSON.parse(packageJsonFile.content) as {
297299
scripts: Record<string, string>;
@@ -306,8 +308,12 @@ test("remix bun scaffolds include runtime guidance, CLI dependencies, and typed-
306308
assert.equal(packageJson.devDependencies["@remix-run/dev"], "latest");
307309
assert.equal(packageJson.devDependencies.vite, "latest");
308310
assert.equal(packageJson.devDependencies["vite-tsconfig-paths"], "latest");
311+
assert.equal(packageJson.devDependencies["@tailwindcss/vite"], "latest");
312+
assert.equal(packageJson.devDependencies["@tailwindcss/postcss"], undefined);
309313
assert.equal(packageJson.dependencies["@remix-run/react"], "latest");
310314
assert.match(viteConfigFile.content, /vitePlugin as remix/);
315+
assert.match(viteConfigFile.content, /@tailwindcss\/vite/);
316+
assert.match(viteConfigFile.content, /plugins: \[remix\(\), tsconfigPaths\(\), tailwindcss\(\)\]/);
311317
assert.match(eslintConfigFile.content, /\*\*\/\*\.\{ts,tsx,mts,cts\}/);
312318
assert.match(eslintConfigFile.content, /projectService: true/);
313319
assert.match(eslintConfigFile.content, /\*\*\/\*\.\{js,mjs,cjs\}/);

0 commit comments

Comments
 (0)