Skip to content

Commit

Permalink
fix: source map generation with pathinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Aug 31, 2021
1 parent ed9c987 commit 7771697
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,11 @@ class MiniCssExtractPlugin {
header = new RawSource(headerStr);
}

source.add(header);

if (startsWithAtRuleImport) {
if (typeof header !== "undefined") {
externalsSource.add(header);
}

// HACK for IE
// http://stackoverflow.com/a/14676665/1458162
if (module.media) {
Expand All @@ -1017,6 +1019,10 @@ class MiniCssExtractPlugin {
externalsSource.add(content);
externalsSource.add("\n");
} else {
if (typeof header !== "undefined") {
source.add(header);
}

if (module.media) {
source.add(`@media ${module.media} {\n`);
}
Expand Down

0 comments on commit 7771697

Please sign in to comment.