Skip to content

Commit

Permalink
fix(CSS): sourcemap support for PostCSS files (#754)
Browse files Browse the repository at this point in the history
* fix(CSS): sourcemap support

* Create hip-spies-happen.md
  • Loading branch information
stipsan authored Dec 17, 2020
1 parent 8142704 commit 8b60fc8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-spies-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'microbundle': patch
---

Enable sourcemaps for CSS
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ function createConfig(options, entry, format, writeMeta) {
// only write out CSS for the first bundle (avoids pointless extra files):
inject: false,
extract: !!writeMeta,
sourceMap: options.sourcemap,
}),
moduleAliases.length > 0 &&
alias({
Expand Down
8 changes: 6 additions & 2 deletions test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ Directory tree:
basic-css
dist
basic-css.css
basic-css.css.map
basic-css.esm.js
basic-css.esm.js.map
basic-css.js
Expand All @@ -454,9 +455,12 @@ Build \\"basicCss\\" to dist:
134 B: basic-css.umd.js.br"
`;
exports[`fixtures build basic-css with microbundle 2`] = `7`;
exports[`fixtures build basic-css with microbundle 2`] = `8`;
exports[`fixtures build basic-css with microbundle 3`] = `"._rHGVB{display:flex;color:red;background:#00f}"`;
exports[`fixtures build basic-css with microbundle 3`] = `
"._rHGVB{display:flex;color:red;background:#00f}
/*# sourceMappingURL=basic-css.css.map */"
`;
exports[`fixtures build basic-css with microbundle 4`] = `
"export default function(){var e=document.createElement(\\"div\\");return e.className=\\"testing\\",e}
Expand Down

0 comments on commit 8b60fc8

Please sign in to comment.