Closed saschagehlich closed 7 years ago
Tests are all in electron-compile, put them there instead and use npm link
to test your changes
While this PR works fine, it seems to break electron-compile's compiler-info.json.gz file, which does not include SassCompiler's compilerOptions anymore, causing the CompileCache to generate an incorrect digest when resolving a file from a packaged application. No idea where this comes from though. Any ideas @paulcbetts ?
@saschagehlich I'll look into it
Imma fix this up tomorrow, sorry it's taking foreverrrrr
Hey @saschagehlich, sorry this took forever. Sass actually already had an option called paths
which also keeps track of the seen directories, so I used that value instead. electron-compilers 5.4.0 has this change
@paulcbetts Cool, thanks! Were you able to reproduce the issue I mentioned above?
No, I tested it with an electron-forge demo app and it all worked (though I didn't try setting an explicit paths
I don't see why it would be different), both dev and packaged modes
@paulcbetts I just started using electron-compile in a project again and it seems that paths
is not a valid option for sass.js :(
Exactly the paths
option is passed to the sass.js's compile
and throw an error because not a valid option.
This allows you to
@import
files from specifiedincludePaths
in your .sass / .scss files. I also added a test suite (mocha) and a test for this feature.A little description on what this actually does:
If an
includePaths
option is specified, the sass compiler callsSass.importer
and passes an importer method that correctly resolves the import requests by iterating over the include paths and resolving the request to the correct file name. It then writes the file content to emscripten's memory usingSass.writeFile
and asks the sass compiler to use the specified path for the import.