Skip to content

Commit 4b06a50

Browse files
lmk123NMFR
authored andcommitted
Fix source map generation on default CSS processor
* Add default `to` option * delete extra bracket
1 parent 7d61e81 commit 4b06a50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ OptimizeCssAssetsPlugin.prototype.print = function() {
2727
}
2828
};
2929

30-
OptimizeCssAssetsPlugin.prototype.processCss = function(css) {
31-
return this.options.cssProcessor.process(css, this.options.cssProcessorOptions);
30+
OptimizeCssAssetsPlugin.prototype.processCss = function(css, assetName) {
31+
return this.options.cssProcessor.process(css, Object.assign({ to: assetName }, this.options.cssProcessorOptions));
3232
};
3333

3434
OptimizeCssAssetsPlugin.prototype.createCssAsset = function(css, originalAsset) {
@@ -65,7 +65,7 @@ OptimizeCssAssetsPlugin.prototype.apply = function(compiler) {
6565

6666
var originalCss = asset.source();
6767

68-
var promise = self.processCss(originalCss);
68+
var promise = self.processCss(originalCss, assetName);
6969

7070
promise.then(
7171
function (result) {

0 commit comments

Comments
 (0)