Skip to content

Commit

Permalink
Fix/css filename output (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed May 26, 2021
1 parent a7f7265 commit 0c91795
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-singers-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'microbundle': patch
---

Ensures JS format is not included in CSS filename output
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,12 @@ function createConfig(options, entry, format, writeMeta) {
modules: cssModulesConfig(options),
// only write out CSS for the first bundle (avoids pointless extra files):
inject: false,
extract: options.css !== 'inline',
extract:
options.css !== 'inline' &&
options.output.replace(
/(\.(umd|cjs|es|m))?\.(mjs|[tj]sx?)$/,
'.css',
),
minimize: options.compress,
sourceMap: options.sourcemap && options.css !== 'inline',
}),
Expand Down

0 comments on commit 0c91795

Please sign in to comment.