sass-loader 14.0.0 → 14.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils.js +8 -1
- package/package.json +12 -5
package/dist/utils.js
CHANGED
|
@@ -228,6 +228,7 @@ const MODULE_REQUEST_REGEX = /^[^?]*~/;
|
|
|
228
228
|
// - ~@org/package
|
|
229
229
|
// - ~@org/package/
|
|
230
230
|
const IS_MODULE_IMPORT = /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;
|
|
231
|
+
const IS_PKG_SCHEME = /^pkg:/i;
|
|
231
232
|
|
|
232
233
|
/**
|
|
233
234
|
* When `sass`/`node-sass` tries to resolve an import, it uses a special algorithm.
|
|
@@ -253,7 +254,11 @@ url, forWebpackResolver = false, fromImport = false) {
|
|
|
253
254
|
if (MODULE_REQUEST_REGEX.test(url)) {
|
|
254
255
|
request = request.replace(MODULE_REQUEST_REGEX, "");
|
|
255
256
|
}
|
|
256
|
-
if (
|
|
257
|
+
if (IS_PKG_SCHEME.test(url)) {
|
|
258
|
+
request = `${request.slice(4)}`;
|
|
259
|
+
return [...new Set([request, url])];
|
|
260
|
+
}
|
|
261
|
+
if (IS_MODULE_IMPORT.test(url) || IS_PKG_SCHEME.test(url)) {
|
|
257
262
|
request = request[request.length - 1] === "/" ? request : `${request}/`;
|
|
258
263
|
return [...new Set([request, url])];
|
|
259
264
|
}
|
|
@@ -416,6 +421,8 @@ function getWebpackResolver(resolverFactory, implementation, includePaths = [])
|
|
|
416
421
|
const needEmulateSassResolver =
|
|
417
422
|
// `sass` doesn't support module import
|
|
418
423
|
!IS_SPECIAL_MODULE_IMPORT.test(request) &&
|
|
424
|
+
// don't handle `pkg:` scheme
|
|
425
|
+
!IS_PKG_SCHEME.test(request) &&
|
|
419
426
|
// We need improve absolute paths handling.
|
|
420
427
|
// Absolute paths should be resolved:
|
|
421
428
|
// - Server-relative URLs - `<context>/path/to/file.ext` (where `<context>` is root context)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sass-loader",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.1",
|
|
4
4
|
"description": "Sass loader for webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack-contrib/sass-loader",
|
|
@@ -22,32 +22,36 @@
|
|
|
22
22
|
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
|
|
23
23
|
"commitlint": "commitlint --from=master",
|
|
24
24
|
"security": "npm audit --production",
|
|
25
|
-
"lint:prettier": "prettier --list-different .",
|
|
25
|
+
"lint:prettier": "prettier --cache --list-different .",
|
|
26
26
|
"lint:js": "eslint --cache .",
|
|
27
|
+
"lint:spelling": "cspell --cache --no-must-find-files --quiet \"**/*.*\"",
|
|
27
28
|
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
28
29
|
"test:only": "cross-env NODE_ENV=test jest",
|
|
29
30
|
"fix:js": "npm run lint:js -- --fix",
|
|
30
31
|
"fix:prettier": "npm run lint:prettier -- --write",
|
|
31
32
|
"fix": "npm-run-all -l fix:js fix:prettier",
|
|
32
|
-
"lint:spelling": "cspell \"**/*.*\"",
|
|
33
33
|
"test:watch": "npm run test:only -- --watch",
|
|
34
34
|
"test:manual": "npm run build && webpack-dev-server test/manual/src/index.js --open --config test/manual/webpack.config.js",
|
|
35
35
|
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
|
36
36
|
"pretest": "npm run lint",
|
|
37
37
|
"test": "npm run test:coverage",
|
|
38
|
-
"prepare": "husky
|
|
38
|
+
"prepare": "husky && npm run build",
|
|
39
39
|
"release": "standard-version"
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
+
"@rspack/core": "0.x || 1.x",
|
|
45
46
|
"node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
46
47
|
"sass": "^1.3.0",
|
|
47
48
|
"sass-embedded": "*",
|
|
48
49
|
"webpack": "^5.0.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependenciesMeta": {
|
|
52
|
+
"@rspack/core": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
51
55
|
"node-sass": {
|
|
52
56
|
"optional": true
|
|
53
57
|
},
|
|
@@ -56,6 +60,9 @@
|
|
|
56
60
|
},
|
|
57
61
|
"sass-embedded": {
|
|
58
62
|
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"webpack": {
|
|
65
|
+
"optional": true
|
|
59
66
|
}
|
|
60
67
|
},
|
|
61
68
|
"dependencies": {
|
|
@@ -83,7 +90,7 @@
|
|
|
83
90
|
"eslint-plugin-import": "^2.28.0",
|
|
84
91
|
"file-loader": "^6.2.0",
|
|
85
92
|
"foundation-sites": "^6.7.5",
|
|
86
|
-
"husky": "^
|
|
93
|
+
"husky": "^9.0.11",
|
|
87
94
|
"jest": "^29.6.2",
|
|
88
95
|
"jest-environment-node-single-context": "^29.1.0",
|
|
89
96
|
"lint-staged": "^15.2.0",
|