Custom file resolvers
It's now possible to pass an array of resolvers in as an option when using modular-css. This allows for resolving files in a different way from the default (node file resolution) to support some other use-cases.
For instance, in rollup:
rollup({
// ...
plugins : [
require("modular-css/rollup")({
css : "./output.css",
resolvers : [
(src, file, resolve) => ...
]
})
]
})A resolver function receives three arguments
srcthe file that the inclusion is based off offilethe path being included fromsrcresolvethe default resolver function, in case that's useful for your resolver