Thanks @slava, @sdarnell!
This is one of those awkward CSS compilation problems where the compiler needs to access imports that are included via an npm library.
The package defines a hook for a type of .css file, then runs it through rework that includes basscss as a local NPM module dependency. I need to transform all @import ‘xxx’ module paths to point to the basscss NPM package and all relative includes to remain relative to the original input file location.
– in meteor app
– in package
- loads ‘my-css-definition.HOOK.css’
- finds all relative @import ‘module’ lines
- rewrites to included basscss npm module path
- finds all @import ‘./my-additional-module’ lines
- rewrites to original file location path using compileStep.inputPath || compileStep.fullInputPath
- processes the result through the transform
- returns the output using compileStep.addStylesheet()
If this is possible it will allow me to write a nice set of modular extensions to basscss in my meteor app and include exactly what is necessary per application.
But if it sounds crazy feel free to sway me otherwise