From 219a337602524c55e3828287d2739609fd06d4d4 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 21 Jan 2025 17:50:50 +0100 Subject: [PATCH] fix: Vite 6 made the CSS output file breaking Bring back the default `style.css` name by default Signed-off-by: Ferdinand Thiessen --- lib/libConfig.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libConfig.ts b/lib/libConfig.ts index c9922cb5..8fcd5262 100644 --- a/lib/libConfig.ts +++ b/lib/libConfig.ts @@ -47,6 +47,14 @@ export interface LibraryOptions extends BaseOptions { * @default ['es'] */ libraryFormats?: LibraryFormats[] + + /** + * Filename of the css output when a single CSS file should be extracted (`inlineCSS: false`) + * Note this only works with Vite 6. + * + * @default `style.css` + */ + cssFileName?: string } /** @@ -63,6 +71,7 @@ export const createLibConfig = (entries: { [entryAlias: string]: string }, optio minify: false, nodeExternalsOptions: {}, libraryFormats: ['es'], + cssFileName: 'style', ...options, } @@ -147,6 +156,7 @@ export const createLibConfig = (entries: { [entryAlias: string]: string }, optio ...entries, }, formats: options.libraryFormats, + cssFileName: options.cssFileName, }, // workaround, see above minify: (options.minify ?? env.mode === 'production') ? 'esbuild' : false,