sass-loader 16.0.2 → 16.0.4

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.
Files changed (3) hide show
  1. package/README.md +13 -11
  2. package/dist/utils.js +3 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -98,11 +98,11 @@ module.exports = {
98
98
 
99
99
  Finally run `webpack` via your preferred method.
100
100
 
101
- ### The `outputStyle` (old API) and `style` (new API) options in `production` mode
101
+ ### The `style` (new API, by default since 16 version) and `outputStyle` (old API) options in `production` mode
102
102
 
103
- For `production` mode, the `outputStyle` (old API) and `style` (new API) options default to `compressed` unless otherwise specified in `sassOptions`.
103
+ For `production` mode, the `style` (new API, by default since 16 version) and `outputStyle` (old API) options default to `compressed` unless otherwise specified in `sassOptions`.
104
104
 
105
- ### Resolving `import` at-rules
105
+ ### Resolving `import` and `use` at-rules
106
106
 
107
107
  Webpack provides an [advanced mechanism to resolve files](https://webpack.js.org/concepts/module-resolution/).
108
108
 
@@ -147,6 +147,7 @@ Thankfully there are two solutions to this problem:
147
147
  - **[`additionalData`](#additionaldata)**
148
148
  - **[`webpackImporter`](#webpackimporter)**
149
149
  - **[`warnRuleAsWarning`](#warnruleaswarning)**
150
+ - **[`api`](#api)**
150
151
 
151
152
  ### `implementation`
152
153
 
@@ -296,13 +297,13 @@ Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://g
296
297
 
297
298
  > [!NOTE]
298
299
  >
299
- > The `indentedSyntax` option is `true` for the `sass` extension.
300
+ > The `syntax` (new API, by default since 16 version)`and`indentedSyntax`(old API) option is`scss`for the`scss`extension,`indented`for the`sass`extension and`css`for the`css` extension.
300
301
 
301
302
  > [!NOTE]
302
303
  >
303
304
  > Options such as `data` and `file` are unavailable and will be ignored.
304
305
 
305
- > ℹ We strongly discourage changing the `outFile`, `sourceMapContents`, `sourceMapEmbed`, and `sourceMapRoot` options because `sass-loader` sets these automatically when the `sourceMap` option is `true`.
306
+ > ℹ We strongly discourage changing the `sourceMap` (new API, by default since 16 version), `outFile` (old API), `sourceMapContents` (old API), `sourceMapEmbed` (old API), and `sourceMapRoot` (old API) options because `sass-loader` sets these automatically when the `sourceMap` option is `true`.
306
307
 
307
308
  > [!NOTE]
308
309
  >
@@ -313,6 +314,7 @@ There is a slight difference between the options for `sass` (`dart-sass`) and `n
313
314
  Please consult their respective documentation before using them:
314
315
 
315
316
  - [Dart Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options) for all available `sass` options.
317
+ - [Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass` options.
316
318
  - [Node Sass documentation](https://github.com/sass/node-sass/#options) for all available `node-sass` options.
317
319
 
318
320
  #### `object`
@@ -334,8 +336,8 @@ module.exports = {
334
336
  loader: "sass-loader",
335
337
  options: {
336
338
  sassOptions: {
337
- indentWidth: 4,
338
- includePaths: ["absolute/path/a", "absolute/path/b"],
339
+ style: `compressed`,
340
+ loadPaths: ["absolute/path/a", "absolute/path/b"],
339
341
  },
340
342
  },
341
343
  },
@@ -369,12 +371,12 @@ module.exports = {
369
371
 
370
372
  if (relativePath === "styles/foo.scss") {
371
373
  return {
372
- includePaths: ["absolute/path/c", "absolute/path/d"],
374
+ loadPaths: ["absolute/path/c", "absolute/path/d"],
373
375
  };
374
376
  }
375
377
 
376
378
  return {
377
- includePaths: ["absolute/path/a", "absolute/path/b"],
379
+ loadPaths: ["absolute/path/a", "absolute/path/b"],
378
380
  };
379
381
  },
380
382
  },
@@ -401,7 +403,7 @@ Enables/Disables generation of source maps.
401
403
  By default generation of source maps depends on the [`devtool`](https://webpack.js.org/configuration/devtool/) option.
402
404
  All values enable source map generation except `eval` and `false`.
403
405
 
404
- > ℹ If `true`, the `sourceMap`, `sourceMapRoot`, `sourceMapEmbed`, `sourceMapContents` and `omitSourceMapUrl` options from `sassOptions` will be ignored.
406
+ > ℹ If `true`, the `sourceMap` (new API, by default since 16 version), `outFile` (old API), `sourceMapContents` (old API), `sourceMapEmbed` (old API), and `sourceMapRoot` (old API) from `sassOptions` will be ignored.
405
407
 
406
408
  **webpack.config.js**
407
409
 
@@ -683,7 +685,7 @@ Type:
683
685
  type api = "legacy" | "modern" | "modern-compiler";
684
686
  ```
685
687
 
686
- Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded` or `"legacy"` for `node-sass`
688
+ Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`, or `"legacy"` for `node-sass`
687
689
 
688
690
  Allows you to switch between the `legacy` and `modern` APIs. You can find more information [here](https://sass-lang.com/documentation/js-api). The `modern-compiler` option enables the modern API with support for [Shared Resources](https://github.com/sass/sass/blob/main/accepted/shared-resources.d.ts.md).
689
691
 
package/dist/utils.js CHANGED
@@ -159,6 +159,7 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
159
159
  }
160
160
  if (useSourceMap) {
161
161
  sassOptions.sourceMap = true;
162
+ sassOptions.sourceMapIncludeSources = true;
162
163
  }
163
164
 
164
165
  // If we are compiling sass and indentedSyntax isn't set, automatically set it.
@@ -599,6 +600,8 @@ function getCompileFn(loaderContext, implementation, apiType) {
599
600
  webpackCompiler.hooks.shutdown.tap("sass-loader", () => {
600
601
  compiler.dispose();
601
602
  });
603
+ } else {
604
+ compiler.dispose();
602
605
  }
603
606
  }
604
607
  return sassModernCompilers.get(webpackCompiler).compileStringAsync(data, rest);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-loader",
3
- "version": "16.0.2",
3
+ "version": "16.0.4",
4
4
  "description": "Sass loader for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/sass-loader",