react-native-sass-transformer
react-native-sass-transformer copied to clipboard
Fix relative path resolution
Previously, this module was incorrectly resolving paths. For an import of A/b
from file /C/d.scss
, it was looking in [/C/A
, /C
, /
] for a file d.android.scss
/d.ios.scss
, d.native.scss
, d.scss
.
For an import of A/b
from file /C/d.scss
, it now looks in [/C/A
, /A
] for a file d.android.scss
/d.ios.scss
, d.native.scss
, d.scss
.
This means that @import 'styles/general'
from a file my-project/component/header/styles.scss
no longer incorrectly resolves to my-project/general.ios.scss
or my-project/component/header/general.ios.scss
. It still resolves to my-project/component/header/styles/general.ios.scss
, if it exists, but if that fails it now falls back to my-project/styles/general.ios.scss
.
I have also submitted this PR to https://github.com/kristerkari/react-native-typed-sass-transformer/pull/4.
Thanks a lot! I'll do some testing for the changes.
When I tried it today, incPaths.map(incPath => path.resolve(incPath, urlPath.dir));
did work instead of the for
loop. I'm not really sure what caused the "FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal."
I'm not really sure what caused the "FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal."
That's an error from NodeJS' V8, so it might get fixed by updating your NodeJS version.