Skip to content

Commit 595a149

Browse files
committed
fix: update
1 parent 8e19cbf commit 595a149

3 files changed

Lines changed: 9 additions & 22 deletions

File tree

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"standard-version": "^9.5.0",
105105
"sugarss": "^5.0.0",
106106
"typescript": "^5.5.4",
107-
"webpack": "https://pkg.pr.new/webpack@11c12b8"
107+
"webpack": "https://pkg.pr.new/webpack@ba3f97c"
108108
},
109109
"peerDependencies": {
110110
"webpack": "^5.0.0"

src/index.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -793,37 +793,24 @@ class CssMinimizerPlugin {
793793
return source;
794794
}
795795

796-
const [content, sourceMap] = source;
797-
798796
if (!contentWorkerFactory) {
799797
contentWorkerFactory = this.createWorkerFactory(
800798
availableNumberOfCores,
801799
);
802800
}
803801

802+
const { source: rawInput, map } = source.sourceAndMap();
803+
804804
const output = await this.transformSource(
805805
compiler,
806806
compilation,
807807
name,
808-
content,
809-
sourceMap,
808+
rawInput,
809+
map,
810810
contentWorkerFactory.getWorker,
811811
);
812812

813-
for (const warning of output.warnings) {
814-
compilation.warnings.push(warning);
815-
}
816-
817-
for (const error of output.errors) {
818-
compilation.errors.push(error);
819-
}
820-
821-
if (output.source) {
822-
const { source: code, map } = output.source.sourceAndMap();
823-
return [/** @type {string} */ (code), map || undefined];
824-
}
825-
826-
return source;
813+
return output.source || source;
827814
},
828815
);
829816
}

0 commit comments

Comments
 (0)