From 4a82a502387c4bd8ff7c98c5730ebc1e92c4dd0f Mon Sep 17 00:00:00 2001 From: "alexander.akait" Date: Tue, 15 Nov 2022 18:04:51 +0300 Subject: [PATCH] fix: support `node-sass` v8 --- src/utils.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index df5e5edc..06fcaed0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -72,10 +72,15 @@ function getSassImplementation(loaderContext, implementation) { // eslint-disable-next-line consistent-return return resolvedImplementation; } else if (implementationName === "node-sass") { - if (!semver.satisfies(version, "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0")) { + if ( + !semver.satisfies( + version, + "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + ) + ) { loaderContext.emitError( new Error( - `Node Sass version ${version} is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0.` + `Node Sass version ${version} is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0.` ) ); } @@ -236,7 +241,8 @@ async function getSassOptions( // - ~@org/ // - ~@org/package // - ~@org/package/ -const isModuleImport = /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/; +const isModuleImport = + /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/; /** * When `sass`/`node-sass` tries to resolve an import, it uses a special algorithm.