Skip to content

Commit

Permalink
fix():error in sass-loader v8.x #7
Browse files Browse the repository at this point in the history
  • Loading branch information
GitOfZGT committed Dec 8, 2021
1 parent 35ac036 commit f68332f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"z-theme": "dist/bin/index.js"
},
"name": "@zougt/some-loader-utils",
"version": "1.4.0-beta.5",
"version": "1.4.0-beta.6",
"description": "implementation for less-loader or sass-loader. Compiles Less or sass to CSS.",
"license": "MIT",
"repository": "GitOfZGT/some-loader-utils",
Expand Down Expand Up @@ -42,7 +42,6 @@
},
"dependencies": {
"cac": "^6.7.12",
"chalk": "^5.0.0",
"color": "^4.0.1",
"cssnano": "^5.0.11",
"cssnano-preset-lite": "^2.0.1",
Expand Down
10 changes: 9 additions & 1 deletion src/getSass.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { v5 as uuidv5 } from 'uuid';

import {
getScopeProcessResult,
getAllStyleVarFiles,
Expand Down Expand Up @@ -90,7 +92,13 @@ export function getSass(opt = {}) {
};
}),
allStyleVarFiles,
renderOptions.file,
// sass-loader v8.x 没有传入renderOptions.file, 用uuid生成一个,防止报错
renderOptions.file ||
(renderOptions.data &&
uuidv5(
renderOptions.data,
'4725327a-3250-4226-86cf-ae5ce775795b'
)),
opt.includeStyleWithColors,
opt.arbitraryMode
);
Expand Down

0 comments on commit f68332f

Please sign in to comment.