Skip to content

Commit 4dd370a

Browse files
Allow specifying Dart Sass implementation
For cases where you're not able to completely remove `node-sass`, causing `sass-loader` to pick it up, you can now explicitly specify you want to use Dart Sass through `USE_DART_SASS=true` env variable.
1 parent 97695bc commit 4dd370a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
5353

5454
const isExtendingEslintConfig = process.env.EXTEND_ESLINT === 'true';
5555

56+
const shouldUseDartSass = process.env.USE_DART_SASS === 'true';
57+
5658
const imageInlineSizeLimit = parseInt(
5759
process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
5860
);
@@ -143,6 +145,7 @@ module.exports = function (webpackEnv) {
143145
loader: require.resolve(preProcessor),
144146
options: {
145147
sourceMap: true,
148+
...(shouldUseDartSass ? { implementation: require('sass') } : {}),
146149
},
147150
}
148151
);

0 commit comments

Comments
 (0)