Skip to content

Commit 9ccf400

Browse files
stipsandevelopit
andauthored
restore CSS sourcemap support (#770)
* fix: restore CSS sourcemap support * no CSS maps when inline Co-authored-by: Jason Miller <[email protected]> Co-authored-by: Jason Miller <[email protected]>
1 parent 52a1771 commit 9ccf400

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ function createConfig(options, entry, format, writeMeta) {
447447
inject: false,
448448
extract: options.css !== 'inline',
449449
minimize: options.compress,
450+
sourceMap: options.sourcemap && options.css !== 'inline',
450451
}),
451452
moduleAliases.length > 0 &&
452453
alias({

test/__snapshots__/index.test.js.snap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ Directory tree:
433433
basic-css
434434
dist
435435
basic-css.css
436+
basic-css.css.map
436437
basic-css.esm.js
437438
basic-css.esm.js.map
438439
basic-css.js
@@ -454,9 +455,12 @@ Build \\"basicCss\\" to dist:
454455
138 B: basic-css.umd.js.br"
455456
`;
456457
457-
exports[`fixtures build basic-css with microbundle 2`] = `7`;
458+
exports[`fixtures build basic-css with microbundle 2`] = `8`;
458459
459-
exports[`fixtures build basic-css with microbundle 3`] = `".testing{display:flex;color:red;background:#00f}"`;
460+
exports[`fixtures build basic-css with microbundle 3`] = `
461+
".testing{display:flex;color:red;background:#00f}
462+
/*# sourceMappingURL=basic-css.css.map */"
463+
`;
460464
461465
exports[`fixtures build basic-css with microbundle 4`] = `
462466
"function e(){var e=document.createElement(\\"div\\");return e.className=\\"testing\\",e}export default e;

0 commit comments

Comments
 (0)