Skip to content

Commit

Permalink
Fix reference pass error in package config (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript authored and devongovett committed May 1, 2018
1 parent ec98a95 commit a36b912
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/assets/LESSAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class LESSAsset extends Asset {
let less = await localRequire('less', this.name);
let render = promisify(less.render.bind(less));

let opts =
this.package.less ||
(await this.getConfig(['.lessrc', '.lessrc.js'])) ||
{};
let opts = Object.assign(
{},
this.package.less || (await this.getConfig(['.lessrc', '.lessrc.js']))
);
opts.filename = this.name;
opts.plugins = (opts.plugins || []).concat(urlPlugin(this));

Expand Down
8 changes: 4 additions & 4 deletions src/assets/SASSAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class SASSAsset extends Asset {
rootDir: this.options.rootDir
});

let opts =
this.package.sass ||
(await this.getConfig(['.sassrc', '.sassrc.js'])) ||
{};
let opts = Object.assign(
{},
this.package.sass || (await this.getConfig(['.sassrc', '.sassrc.js']))
);
opts.includePaths = (opts.includePaths || []).concat(
path.dirname(this.name)
);
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/postcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function getConfig(asset) {
return;
}

config = config || {};
config = Object.assign({}, config);

let postcssModulesConfig = {
getJSON: (filename, json) => (asset.cssModules = json)
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/posthtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function getConfig(asset) {
return;
}

config = config || {};
config = Object.assign({}, config);
config.plugins = await loadPlugins(config.plugins, asset.name);
config.skipParse = true;
return config;
Expand Down

0 comments on commit a36b912

Please sign in to comment.