Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reference pass error in package config #1149

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -15,10 +15,10 @@ class SASSAsset extends Asset {
let sass = await localRequire('node-sass', this.name);
let render = promisify(sass.render.bind(sass));

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