sass-loader 13.0.1 → 13.1.0

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/README.md CHANGED
@@ -798,10 +798,9 @@ module.exports = {
798
798
 
799
799
  For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.
800
800
 
801
- There are two possibilities to extract a style sheet from the bundle:
801
+ There are four possibilities to extract a style sheet from the bundle:
802
802
 
803
- - [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)
804
- - [extract-loader](https://github.com/peerigon/extract-loader) (simpler, but specialized on the css-loader's output)
803
+ #### 1. [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)
805
804
 
806
805
  **webpack.config.js**
807
806
 
@@ -835,6 +834,68 @@ module.exports = {
835
834
  };
836
835
  ```
837
836
 
837
+ #### 2. [Asset Modules](https://webpack.js.org/guides/asset-modules/)
838
+
839
+ **webpack.config.js**
840
+
841
+ ```js
842
+ module.exports = {
843
+ entry: [__dirname + "/src/scss/app.scss"],
844
+ module: {
845
+ rules: [
846
+ {
847
+ test: /\.js$/,
848
+ exclude: /node_modules/,
849
+ use: [],
850
+ },
851
+ {
852
+ test: /\.scss$/,
853
+ exclude: /node_modules/,
854
+ type: "asset/resource",
855
+ generator: {
856
+ filename: "bundle.css",
857
+ },
858
+ use: ["sass-loader"],
859
+ },
860
+ ],
861
+ },
862
+ };
863
+ ```
864
+
865
+ #### 3. [extract-loader](https://github.com/peerigon/extract-loader) (simpler, but specialized on the css-loader's output)
866
+
867
+ #### 4. [file-loader](https://github.com/webpack-contrib/file-loader) (deprecated--should only be used in Webpack v4)
868
+
869
+ **webpack.config.js**
870
+
871
+ ```js
872
+ module.exports = {
873
+ entry: [__dirname + "/src/scss/app.scss"],
874
+ module: {
875
+ rules: [
876
+ {
877
+ test: /\.js$/,
878
+ exclude: /node_modules/,
879
+ use: [],
880
+ },
881
+ {
882
+ test: /\.scss$/,
883
+ exclude: /node_modules/,
884
+ use: [
885
+ {
886
+ loader: "file-loader",
887
+ options: { outputPath: "css/", name: "[name].min.css" },
888
+ },
889
+ "sass-loader",
890
+ ],
891
+ },
892
+ ],
893
+ },
894
+ };
895
+ ```
896
+
897
+ (source: https://stackoverflow.com/a/60029923/2969615)
898
+
838
899
  ### Source maps
839
900
 
840
901
  Enables/Disables generation of source maps.
package/dist/SassError.js CHANGED
@@ -8,7 +8,11 @@ exports.default = void 0;
8
8
  class SassError extends Error {
9
9
  constructor(sassError) {
10
10
  super();
11
- this.name = "SassError";
11
+ this.name = "SassError"; // Instruct webpack to hide the JS stack from the console.
12
+ // Usually you're only interested in the SASS error in this case.
13
+
14
+ this.hideStack = true;
15
+ Error.captureStackTrace(this, this.constructor);
12
16
 
13
17
  if (typeof sassError.line !== "undefined" || typeof sassError.column !== "undefined") {
14
18
  this.loc = {
@@ -21,11 +25,7 @@ class SassError extends Error {
21
25
  this.message = `${this.name}: ${typeof sassError.message !== "undefined" ? sassError.message : sassError}`;
22
26
 
23
27
  if (sassError.formatted) {
24
- this.message = `${this.name}: ${sassError.formatted.replace(/^Error: /, "")}`; // Instruct webpack to hide the JS stack from the console.
25
- // Usually you're only interested in the SASS stack in this case.
26
-
27
- this.hideStack = true;
28
- Error.captureStackTrace(this, this.constructor);
28
+ this.message = `${this.name}: ${sassError.formatted.replace(/^Error: /, "")}`;
29
29
  }
30
30
  }
31
31
 
package/dist/utils.js CHANGED
@@ -463,7 +463,7 @@ function getWebpackResolver(resolverFactory, implementation, includePaths = [])
463
463
  }));
464
464
  const webpackModuleResolve = promiseResolve(resolverFactory({
465
465
  dependencyType: "sass",
466
- conditionNames: ["sass", "style"],
466
+ conditionNames: ["sass", "style", "..."],
467
467
  mainFields: ["sass", "style", "main", "..."],
468
468
  mainFiles: ["_index", "index", "..."],
469
469
  extensions: [".sass", ".scss", ".css"],
@@ -472,7 +472,7 @@ function getWebpackResolver(resolverFactory, implementation, includePaths = [])
472
472
  }));
473
473
  const webpackImportResolve = promiseResolve(resolverFactory({
474
474
  dependencyType: "sass",
475
- conditionNames: ["sass", "style"],
475
+ conditionNames: ["sass", "style", "..."],
476
476
  mainFields: ["sass", "style", "main", "..."],
477
477
  mainFiles: ["_index.import", "_index", "index.import", "index", "..."],
478
478
  extensions: [".sass", ".scss", ".css"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-loader",
3
- "version": "13.0.1",
3
+ "version": "13.1.0",
4
4
  "description": "Sass loader for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/sass-loader",
@@ -63,13 +63,13 @@
63
63
  "neo-async": "^2.6.2"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/cli": "^7.17.10",
67
- "@babel/core": "^7.18.2",
68
- "@babel/preset-env": "^7.18.2",
69
- "@commitlint/cli": "^17.0.2",
70
- "@commitlint/config-conventional": "^17.0.2",
66
+ "@babel/cli": "^7.19.3",
67
+ "@babel/core": "^7.19.3",
68
+ "@babel/preset-env": "^7.19.3",
69
+ "@commitlint/cli": "^17.1.2",
70
+ "@commitlint/config-conventional": "^17.1.0",
71
71
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
72
- "babel-jest": "^28.1.0",
72
+ "babel-jest": "^29.1.2",
73
73
  "bootstrap-sass": "^3.4.1",
74
74
  "bootstrap-v4": "npm:bootstrap@^4.5.3",
75
75
  "bootstrap-v5": "npm:bootstrap@^5.0.1",
@@ -77,29 +77,29 @@
77
77
  "css-loader": "^6.6.0",
78
78
  "del": "^6.1.1",
79
79
  "del-cli": "^4.0.1",
80
- "enhanced-resolve": "^5.8.2",
81
- "eslint": "^8.16.0",
80
+ "enhanced-resolve": "^5.10.0",
81
+ "eslint": "^8.24.0",
82
82
  "eslint-config-prettier": "^8.3.0",
83
83
  "eslint-plugin-import": "^2.25.4",
84
- "fibers": "^5.0.1",
84
+ "fibers": "^5.0.3",
85
85
  "file-loader": "^6.2.0",
86
- "foundation-sites": "^6.6.3",
86
+ "foundation-sites": "^6.7.5",
87
87
  "husky": "^8.0.1",
88
- "jest": "^28.1.0",
89
- "jest-environment-node-single-context": "^28.0.0",
88
+ "jest": "^29.1.2",
89
+ "jest-environment-node-single-context": "^29.0.0",
90
90
  "lint-staged": "^12.5.0",
91
91
  "material-components-web": "^8.0.0",
92
- "memfs": "^3.4.4",
92
+ "memfs": "^3.4.7",
93
93
  "node-sass": "^7.0.1",
94
94
  "node-sass-glob-importer": "^5.3.2",
95
95
  "npm-run-all": "^4.1.5",
96
- "prettier": "^2.3.2",
97
- "sass": "^1.52.1",
98
- "sass-embedded": "^1.52.1",
99
- "semver": "^7.3.5",
96
+ "prettier": "^2.7.1",
97
+ "sass": "^1.55.0",
98
+ "sass-embedded": "^1.55.0",
99
+ "semver": "^7.3.8",
100
100
  "standard-version": "^9.3.1",
101
101
  "style-loader": "^3.2.1",
102
- "webpack": "^5.73.0"
102
+ "webpack": "^5.74.0"
103
103
  },
104
104
  "keywords": [
105
105
  "sass",