Skip to content

Commit

Permalink
fix: support node-sass v8 (#1103)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Nov 15, 2022
1 parent 076283b commit 88735bc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/utils.js
Expand Up @@ -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.`
)
);
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 88735bc

Please sign in to comment.