Skip to content

Commit

Permalink
fix: Vite 6 made the CSS output file breaking
Browse files Browse the repository at this point in the history
Bring back the default `style.css` name by default

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Jan 21, 2025
1 parent 33d7a7a commit 219a337
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/libConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand All @@ -63,6 +71,7 @@ export const createLibConfig = (entries: { [entryAlias: string]: string }, optio
minify: false,
nodeExternalsOptions: {},
libraryFormats: ['es'],
cssFileName: 'style',
...options,
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 219a337

Please sign in to comment.