From 0002811bbf6cddbdec4768210f3f90014f62f842 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Mon, 16 Dec 2019 22:20:33 +0600 Subject: [PATCH 1/3] 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 ) { From 4e79666345b2b5675f38762abd932c513dfd9977 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Tue, 17 Dec 2019 13:03:11 +0600 Subject: [PATCH 2/3] Single quotes --- sass-transformer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass-transformer.js b/sass-transformer.js index f48e7e5497..21a31730cb 100644 --- a/sass-transformer.js +++ b/sass-transformer.js @@ -88,7 +88,7 @@ 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; - const partialfname = includePath + "/_" + name + extension; + const partialfname = includePath + '/_' + name + extension; return fs.existsSync( fname ) || fs.existsSync( partialfname ); } ); From 016e6845b3de82dafccc20a3a798d4758b147b64 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Tue, 17 Dec 2019 13:03:41 +0600 Subject: [PATCH 3/3] Also update sass-transformer-inside-gb.js --- sass-transformer-inside-gb.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sass-transformer-inside-gb.js b/sass-transformer-inside-gb.js index f407712536..f4a3a0fdb6 100644 --- a/sass-transformer-inside-gb.js +++ b/sass-transformer-inside-gb.js @@ -81,7 +81,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 ) {