From 0002811bbf6cddbdec4768210f3f90014f62f842 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Mon, 16 Dec 2019 22:20:33 +0600 Subject: [PATCH] Sass Transformer: Also look for partials Add support for [SASS partials](https://sass-lang.com/guide), as is already present [upstream](https://github.com/kristerkari/react-native-sass-transformer/blob/52884dd59582856fa17e2b2e8ca9efc37d412387/index.js#L41-L42). This should fix the issue introduced by https://github.com/WordPress/gutenberg/pull/19159, and discussed there. --- sass-transformer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sass-transformer.js b/sass-transformer.js index cc95d18fb9..f48e7e5497 100644 --- a/sass-transformer.js +++ b/sass-transformer.js @@ -88,7 +88,8 @@ function findVariant( name, extensions, includePaths ) { // try to find the file iterating through the extensions, in order. const foundExtention = extensions.find( ( extension ) => { const fname = includePath + '/' + name + extension; - return fs.existsSync( fname ); + const partialfname = includePath + "/_" + name + extension; + return fs.existsSync( fname ) || fs.existsSync( partialfname ); } ); if ( foundExtention ) {