Skip to content

Commit 0c91795

Browse files
authored
Fix/css filename output (#841)
1 parent a7f7265 commit 0c91795

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/shy-singers-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': patch
3+
---
4+
5+
Ensures JS format is not included in CSS filename output

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,12 @@ function createConfig(options, entry, format, writeMeta) {
457457
modules: cssModulesConfig(options),
458458
// only write out CSS for the first bundle (avoids pointless extra files):
459459
inject: false,
460-
extract: options.css !== 'inline',
460+
extract:
461+
options.css !== 'inline' &&
462+
options.output.replace(
463+
/(\.(umd|cjs|es|m))?\.(mjs|[tj]sx?)$/,
464+
'.css',
465+
),
461466
minimize: options.compress,
462467
sourceMap: options.sourcemap && options.css !== 'inline',
463468
}),

0 commit comments

Comments
 (0)