Skip to content

Commit a337219

Browse files
feat!: remove node-sass support (#1313)
1 parent 243d68e commit a337219

34 files changed

Lines changed: 962 additions & 1254918 deletions

.github/workflows/nodejs.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ jobs:
4242
node-version: ${{ matrix.node-version }}
4343
cache: "npm"
4444

45-
- run: npm uninstall node-sass
46-
4745
- name: Install dependencies
4846
run: npm ci
4947

@@ -90,17 +88,9 @@ jobs:
9088
node-version: ${{ matrix.node-version }}
9189
cache: "npm"
9290

93-
- name: Install webpack ${{ matrix.webpack-version }}
94-
if: matrix.node-version == '22.x' || matrix.node-version == '24.x'
95-
run: npm uninstall node-sass
96-
9791
- name: Install dependencies
9892
run: npm ci
9993

100-
- name: Install webpack ${{ matrix.webpack-version }}
101-
if: matrix.webpack-version != 'latest'
102-
run: npm i webpack@${{ matrix.webpack-version }}
103-
10494
- name: Run tests for webpack version ${{ matrix.webpack-version }}
10595
run: npm run test:coverage -- --ci
10696

README.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,14 @@ pnpm add -D sass-loader sass webpack
4343
>
4444
> To enable CSS processing in your project, you need to install [style-loader](https://webpack.js.org/loaders/style-loader/) and [css-loader](https://webpack.js.org/loaders/css-loader/) via `npm i style-loader css-loader`.
4545
46-
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass), [Node Sass](https://github.com/sass/node-sass) on your own (more documentation can be found below) or [Sass Embedded](https://github.com/sass/embedded-host-node).
46+
`sass-loader` requires you to install either [Dart Sass](https://github.com/sass/dart-sass) or [Sass Embedded](https://github.com/sass/embedded-host-node) on your own (more documentation can be found below).
4747

4848
This allows you to control the versions of all your dependencies and to choose which Sass implementation to use.
4949

5050
> [!NOTE]
5151
>
5252
> We highly recommend using [Sass Embedded](https://github.com/sass/embedded-host-node) or [Dart Sass](https://github.com/sass/dart-sass).
5353
54-
> [!WARNING]
55-
>
56-
> [Node Sass](https://github.com/sass/node-sass) does not work with [Yarn PnP](https://classic.yarnpkg.com/en/docs/pnp/) and doesn't support [@use rule](https://sass-lang.com/documentation/at-rules/use).
57-
5854
Chain the `sass-loader` with the [css-loader](https://github.com/webpack/css-loader) and the [style-loader](https://github.com/webpack/style-loader) to immediately apply all styles to the DOM, or with the [mini-css-extract-plugin](https://github.com/webpack/mini-css-extract-plugin) to extract it into a separate file.
5955

6056
Then add the loader to your webpack configuration. For example:
@@ -167,7 +163,7 @@ Default: `sass`
167163
The special `implementation` option determines which implementation of Sass to use.
168164

169165
By default, the loader resolves the implementation based on your dependencies.
170-
Just add the desired implementation to your `package.json` (`sass`, `sass-embedded`, or `node-sass` package) and install dependencies.
166+
Just add the desired implementation to your `package.json` (`sass` or `sass-embedded` package) and install dependencies.
171167

172168
Example where the `sass-loader` uses the `sass` (`dart-sass`) implementation:
173169

@@ -182,19 +178,6 @@ Example where the `sass-loader` uses the `sass` (`dart-sass`) implementation:
182178
}
183179
```
184180

185-
Example where the `sass-loader` uses the `node-sass` implementation:
186-
187-
**package.json**
188-
189-
```json
190-
{
191-
"devDependencies": {
192-
"sass-loader": "^7.2.0",
193-
"node-sass": "^5.0.0"
194-
}
195-
}
196-
```
197-
198181
Example where the `sass-loader` uses the `sass-embedded` implementation:
199182

200183
**package.json**
@@ -219,7 +202,6 @@ Be aware of the order that `sass-loader` will resolve the implementation:
219202

220203
1. `sass-embedded`
221204
2. `sass`
222-
3. `node-sass`
223205

224206
You can specify a specific implementation by using the `implementation` option, which accepts one of the above values.
225207

@@ -293,7 +275,7 @@ type sassOptions =
293275

294276
Default: defaults values for Sass implementation
295277

296-
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://github.com/sass/node-sass) implementation.
278+
Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Sass Embedded](https://github.com/sass/embedded-host-node) implementation.
297279

298280
> [!NOTE]
299281
>
@@ -313,13 +295,10 @@ Options for [Dart Sass](http://sass-lang.com/dart-sass) or [Node Sass](https://g
313295
>
314296
> Access to the [loader context](https://webpack.js.org/api/loaders/#the-loader-context) inside the custom importer can be done using the `this.webpackLoaderContext` property.
315297
316-
There is a slight difference between the options for `sass` (`dart-sass`) and `node-sass`.
317-
318298
Please consult their respective documentation before using them:
319299

320300
- [Dart Sass documentation](https://sass-lang.com/documentation/js-api/interfaces/Options) for all available `sass` options.
321-
- [Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass` options.
322-
- [Node Sass documentation](https://github.com/sass/node-sass/#options) for all available `node-sass` options.
301+
- [Sass Embedded documentation](https://github.com/sass/embedded-host-node) for all available `sass-embedded` options.
323302

324303
#### `object`
325304

@@ -438,10 +417,6 @@ module.exports = {
438417
};
439418
```
440419

441-
> ℹ In some rare cases `node-sass` can output invalid source maps (this is a `node-sass` bug).
442-
>
443-
> In order to avoid this, you can try to update `node-sass` to the latest version, or you can try to set within `sassOptions` the `outputStyle` option to `compressed`.
444-
445420
**webpack.config.js**
446421

447422
```js
@@ -593,7 +568,7 @@ Default: `true`
593568
Enables/disables the default webpack importer.
594569

595570
This can improve performance in some cases, though use it with caution because aliases and `@import` at-rules starting with `~` will not work.
596-
You can pass your own `importer` to solve this (see [`importer` docs](https://github.com/sass/node-sass#importer--v200---experimental)).
571+
You can pass your own `importer` to solve this (see [Sass importer documentation](https://sass-lang.com/documentation/js-api/interfaces/LegacyImporter)).
597572

598573
**webpack.config.js**
599574

@@ -689,7 +664,7 @@ Type:
689664
type api = "legacy" | "modern" | "modern-compiler";
690665
```
691666

692-
Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`, or `"legacy"` for `node-sass`
667+
Default: `"modern"` for `sass` (`dart-sass`) and `sass-embedded`
693668

694669
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).
695670

jest.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)