Skip to content

Commit

Permalink
fix(): lack of deps and error when multipleScopeVars is []
Browse files Browse the repository at this point in the history
  • Loading branch information
GitOfZGT committed Oct 27, 2021
1 parent 14c20aa commit 5cba1c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zougt/some-loader-utils",
"version": "1.3.1",
"version": "1.3.2",
"description": "implementation for less-loader or sass-loader. Compiles Less or sass to CSS.",
"license": "MIT",
"repository": "GitOfZGT/some-loader-utils",
Expand Down
7 changes: 5 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import postcssAddScopeName from './postcss-addScopeName';
const getAllStyleVarFiles = (loaderContext, options) => {
const styleVarFiles = options.multipleScopeVars;
let allStyleVarFiles = [{ scopeName: '', path: '' }];
if (Array.isArray(styleVarFiles)) {
if (Array.isArray(styleVarFiles) && styleVarFiles.length) {
if (styleVarFiles.length === 1) {
allStyleVarFiles = styleVarFiles.map((item) => {
if (Array.isArray(item.path)) {
Expand Down Expand Up @@ -143,7 +143,10 @@ const getScopeProcessResult = (
}
});
});

preprocessResult.deps = [
...preprocessResult.deps,
...(cssResults[0].deps || []),
];
/**
* 用cssResults的第一个css内容进入postcss
*/
Expand Down

0 comments on commit 5cba1c7

Please sign in to comment.