Replies: 1 comment 10 replies
-
|
I found a I also found #2320 (comment) from @zachleat, which says:
I'm testing in @11ty/eleventy@canary (v2.0.0-canary.12) per https://www.11ty.dev/docs/events/#event-arguments "Coming soon in v2.0.0" comment; but am seeing subtle differences between the [undocumented] > eleventy --output=bananasinpajamas
plugin: { input: 'src', includes: '_includes', data: '_data', output: 'www' }
{
'eleventy.directories': {
input: 'src',
data: 'src/_data',
includes: 'src/_includes',
layouts: undefined,
output: 'bananasinpajamas'
}
}
{
'eleventy.before': {
inputDir: 'src',
dir: {
input: 'src',
includes: '_includes',
data: '_data',
output: 'www'
},
runMode: 'build',
outputMode: 'fs'
}
}
[11ty] Writing bananasinpajamas/index.html from ./src/index.njk
[11ty] Wrote 1 file in 0.05 seconds (v2.0.0-canary.12)Where my custom plugin is: module.exports = function (eleventyConfig, pluginConfig={}) {
console.log(`plugin: ${inspect(eleventyConfig.dir)}`);
eleventyConfig.on('eleventy.before', async (data) => {
console.log({"eleventy.before": data});
});
eleventyConfig.on('eleventy.directories', async (data) => {
console.log({"eleventy.directories": data});
});
};and my .eleventy.js looks like this: module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(require("./plugin"));
eleventyConfig.addFilter("inspect", require("node:util").inspect);
return {
dir: {
input: "src",
output: "www",
}
};
};So, you can see that my .eleventy.js config file sets the I still can't seem to find an easier way to get the fully resolved output directory from within a plugin, since using the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am writing a plugin that generates files that need to be written to the output directory.
I can't find any method to get the full path to the output directory. Specifically, if the path is passed with --output argument to elements.
Can someone please point me in the right direction?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions