Skip to content

Commit

Permalink
restore CSS sourcemap support (#770)
Browse files Browse the repository at this point in the history
* fix: restore CSS sourcemap support

* no CSS maps when inline

Co-authored-by: Jason Miller <[email protected]>

Co-authored-by: Jason Miller <[email protected]>
  • Loading branch information
stipsan and developit authored Dec 19, 2020
1 parent 52a1771 commit 9ccf400
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ function createConfig(options, entry, format, writeMeta) {
inject: false,
extract: options.css !== 'inline',
minimize: options.compress,
sourceMap: options.sourcemap && options.css !== 'inline',
}),
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:
138 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`] = `".testing{display:flex;color:red;background:#00f}"`;
exports[`fixtures build basic-css with microbundle 3`] = `
".testing{display:flex;color:red;background:#00f}
/*# sourceMappingURL=basic-css.css.map */"
`;
exports[`fixtures build basic-css with microbundle 4`] = `
"function e(){var e=document.createElement(\\"div\\");return e.className=\\"testing\\",e}export default e;
Expand Down

0 comments on commit 9ccf400

Please sign in to comment.