Open callumlocke opened 7 years ago
You can't do this, but what you can do is pass in a plugin that overrides both the resolve
and the read
method:
const customLoadPlugin = {
// if you do not provide both of these methods, the default implementation is used for the other method.
resolve(filename, source, loadOptions) {
// return a fully resolved path from the relative `filename` and the `source` filename
},
read(filename, loadOptions) {
// return the pug source code as a string for `filename`.
},
};
pug.compile(templateString, {
filename: 'foo.pug',
basedir: somePath,
plugins: [customLoadPlugin],
});
Currently this is un-documented, so there is still some work for us to do here.
I asked about this a couple of years ago but it was never resolved.
I want to tell pug to use my own fork of pug-load instead of the real pug-load.
But that
loader
option doesn't exist, as far as I can tell. Is there any way to configure pug to use my loader?