Skip to content

Commit 17249fc

Browse files
committed
bump: sass-loader
1 parent 79c16cb commit 17249fc

File tree

7 files changed

+11
-32
lines changed

7 files changed

+11
-32
lines changed

crates/next-core/src/next_shared/webpack_rules/sass.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,10 @@ pub async fn get_sass_loader_rules(
3838
sass_options: Vc<JsonValue>,
3939
) -> Result<Vec<(RcStr, LoaderRuleItem)>> {
4040
let sass_options = sass_options.await?;
41-
let Some(mut sass_options) = sass_options.as_object().cloned() else {
41+
let Some(sass_options) = sass_options.as_object().cloned() else {
4242
bail!("sass_options must be an object");
4343
};
4444

45-
// TODO: Remove this once we upgrade to sass-loader 16
46-
let silence_deprecations = if let Some(v) = sass_options.get("silenceDeprecations") {
47-
v.clone()
48-
} else {
49-
serde_json::json!(["legacy-js-api"])
50-
};
51-
52-
sass_options.insert("silenceDeprecations".into(), silence_deprecations);
53-
5445
// additionalData is a loader option but Next.js has it under `sassOptions` in
5546
// `next.config.js`
5647
let additional_data = sass_options

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
"recast": "0.23.11",
315315
"regenerator-runtime": "0.13.4",
316316
"safe-stable-stringify": "2.5.0",
317-
"sass-loader": "15.0.0",
317+
"sass-loader": "16.0.5",
318318
"schema-utils2": "npm:[email protected]",
319319
"schema-utils3": "npm:[email protected]",
320320
"semver": "7.3.2",

packages/next/src/build/webpack/config/blocks/css/index.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,7 @@ export const css = curry(async function css(
174174
// Source maps are required so that `resolve-url-loader` can locate
175175
// files original to their source directory.
176176
sourceMap: true,
177-
sassOptions: {
178-
// The "fibers" option is not needed for Node.js 16+, but it's causing
179-
// problems for Node.js <= 14 users as you'll have to manually install
180-
// the `fibers` package:
181-
// https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package
182-
// https://github.com/vercel/next.js/issues/45052
183-
// Since it's optional and not required, we'll disable it by default
184-
// to avoid the confusion.
185-
fibers: false,
186-
// TODO: Remove this once we upgrade to sass-loader 16
187-
silenceDeprecations: ['legacy-js-api'],
188-
...sassOptions,
189-
},
177+
sassOptions,
190178
additionalData: sassPrependData || sassAdditionalData,
191179
},
192180
},

packages/next/src/compiled/sass-loader/cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/next/taskfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ export async function ncc_sass_loader(task, opts) {
18781878
await fs.writeFile(
18791879
utilsPath,
18801880
originalContent.replace(
1881-
/require\.resolve\(["'](sass|node-sass)["']\)/g,
1881+
/require\.resolve\(["'](sass|node-sass|sass-embedded)["']\)/g,
18821882
'eval("require").resolve("$1")'
18831883
)
18841884
)

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/app-dir/scss/basic-module-include-paths/basic-module-include-paths.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { nextTestSetup } from 'e2e-utils'
33
import { colorToRgb } from 'next-test-utils'
44

55
const sassOptions = {
6-
includePaths: ['./styles'],
6+
loadPaths: ['./styles'],
77
}
88

99
describe.each([

0 commit comments

Comments
 (0)