From acdebe247b16745b133fd36fbdb539c402565078 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Sun, 22 Dec 2024 21:50:08 +0100 Subject: [PATCH 1/2] Build process: Change Dart-Sass to new API --- build/build-modules-js/javascript/compile-to-es2017.es6.js | 4 ++-- build/build-modules-js/stylesheets/handle-scss.es6.js | 2 +- build/build-modules-js/stylesheets/scss-transform.es6.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build-modules-js/javascript/compile-to-es2017.es6.js b/build/build-modules-js/javascript/compile-to-es2017.es6.js index b3c005513adb1..4c56844c9d7a8 100644 --- a/build/build-modules-js/javascript/compile-to-es2017.es6.js +++ b/build/build-modules-js/javascript/compile-to-es2017.es6.js @@ -8,7 +8,7 @@ const { nodeResolve } = require('@rollup/plugin-node-resolve'); const replace = require('@rollup/plugin-replace'); const { babel } = require('@rollup/plugin-babel'); const LightningCSS = require('lightningcss'); -const { renderSync } = require('sass-embedded'); +const { compile } = require('sass-embedded'); const { minifyJsCode } = require('./minify.es6.js'); const { getPackagesUnderScope } = require('../init/common/resolve-package.es6.js'); @@ -33,7 +33,7 @@ const getWcMinifiedCss = async (file) => { if (scssFileExists) { let compiled; try { - compiled = renderSync({ file: scssFile }); + compiled = compile(scssFile); } catch (error) { // eslint-disable-next-line no-console console.error(`${error.column} diff --git a/build/build-modules-js/stylesheets/handle-scss.es6.js b/build/build-modules-js/stylesheets/handle-scss.es6.js index 314f400b39c0c..3fecfa5498ac1 100644 --- a/build/build-modules-js/stylesheets/handle-scss.es6.js +++ b/build/build-modules-js/stylesheets/handle-scss.es6.js @@ -12,7 +12,7 @@ module.exports.handleScssFile = async (file) => { let compiled; try { - compiled = Sass.renderSync({ file }); + compiled = Sass.compile(file); } catch (error) { // eslint-disable-next-line no-console console.error(error.formatted); diff --git a/build/build-modules-js/stylesheets/scss-transform.es6.js b/build/build-modules-js/stylesheets/scss-transform.es6.js index 6cb29421016ce..d4206035140c9 100644 --- a/build/build-modules-js/stylesheets/scss-transform.es6.js +++ b/build/build-modules-js/stylesheets/scss-transform.es6.js @@ -10,7 +10,7 @@ module.exports.compile = async (file) => { let compiled; try { - compiled = Sass.renderSync({ file }); + compiled = Sass.compile({ file }); } catch (error) { // eslint-disable-next-line no-console console.error(error.formatted); From 6ee6d4c8f3e5b9f61b8e77e31a49a19584970fcf Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Tue, 7 Jan 2025 19:14:31 +0100 Subject: [PATCH 2/2] Update build/build-modules-js/stylesheets/scss-transform.es6.js Co-authored-by: Richard Fath --- build/build-modules-js/stylesheets/scss-transform.es6.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build-modules-js/stylesheets/scss-transform.es6.js b/build/build-modules-js/stylesheets/scss-transform.es6.js index d4206035140c9..123a95eb64f40 100644 --- a/build/build-modules-js/stylesheets/scss-transform.es6.js +++ b/build/build-modules-js/stylesheets/scss-transform.es6.js @@ -10,7 +10,7 @@ module.exports.compile = async (file) => { let compiled; try { - compiled = Sass.compile({ file }); + compiled = Sass.compile(file); } catch (error) { // eslint-disable-next-line no-console console.error(error.formatted);