Skip to content

Commit 67c796b

Browse files
committed
hack(ui): force preservation of tailwind plugins
1 parent e1a8d95 commit 67c796b

File tree

5 files changed

+32
-501
lines changed

5 files changed

+32
-501
lines changed

unraid-ui/src/theme/import-hack.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Purpose: force vite to include these dependencies in the build output.
2+
// They don't show up when required, so the build will fail in CI.
3+
// When imported as ESM, some combination of our dependencies causes the imports to err out at runtime
4+
// and break tailwind config resolution.
5+
//
6+
// By adding these imports as side effects to the vite build, we can brute-force the desired behavior.
7+
// Once we have a better understanding of the root cause, and our dependencies have stabilized, we should remove this hack.
8+
import "@tailwindcss/typography";
9+
import "tailwindcss-animate";

unraid-ui/src/theme/preset.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { Config } from "tailwindcss";
22
import type { PluginAPI } from "tailwindcss/types/config";
3-
// import typography from "@tailwindcss/typography";
4-
// import animate from "tailwindcss-animate";
53

64
export const unraidPreset = {
75
darkMode: ['selector', '[data-mode="dark"]'],
@@ -241,5 +239,5 @@ export const unraidPreset = {
241239
}),
242240
},
243241
},
244-
plugins: [require("@tailwindcss/typography"), require("tailwindcss-animate")],
242+
plugins: [require('@tailwindcss/typography'), require('tailwindcss-animate')],
245243
} satisfies Partial<Config>;

unraid-ui/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default function createConfig() {
3434
index: resolve(__dirname, 'src/index.ts'),
3535
tailwind: resolve(__dirname, 'tailwind.config.ts'),
3636
preset: resolve(__dirname, 'src/theme/preset.ts'),
37+
importHack: resolve(__dirname, 'src/theme/import-hack.ts'),
3738
},
3839
preserveEntrySignatures: 'allow-extension',
3940
output: {

0 commit comments

Comments
 (0)