Open Jikstra opened 6 years ago
To have consistent import resolving methods, we need to patch them for pug, sass and the require for js. How to overwrite the resolve methods:
With a consistent resolve method, features like this would be nice:
@npm/nox-component-xyz
import something from a npm module@composer/nox-component-foo
import something from a composer module@ROOT/node_modules/xyz/blubb/foo.pug
import something from the ROOT folder (where package.json is in)A consistent importer should also allow this:
/template/blubb
) resolves to the /path/to/nox/project/src/template/blubb
/template/a-folder
should resolve to /template/a-folder/index.pug/sass
)
Currently in sass we have to do something like:
@import template/blubb.sass
to import/src/template/blubb.sass
while in pug we doinclude /template/blubb.sass
to import/src/template/blubb.sass
. Both should start with an/
for absolute (relative to the source folder) imports