You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A more robust way to export config object via your configuration file. We’ll encourage folks to do this from now on instead of returning an object in your configuration callback (or even the set*Directory methods to programmatically set directories).
Setting directories data cascade (order of precedence):
CLI --input (overrides input from any other methods)
CLI --output (overrides output from any other methods)
dir property in return object from configuration callback (backwards compatibility)
config export from configuration file with a dir object inside (this is the new thing)
Examples
ESM
exportdefaultfunction(eleventyConfig){eleventyConfig.directories.input;// has "./content/"};exportconstconfig={dir: {input: "content"}}
CommonJS
module.exports=function(eleventyConfig){eleventyConfig.directories.input;// has "./content/"};module.exports.config={dir: {input: "content"}}
Update April 10: swapping this to be config instead of directories so that it works the same as the current return object. Switch your return to named config export instead.
Related to #1503 and #3244. Specifically the comment in #1503 (comment)
A more robust way to export config object via your configuration file. We’ll encourage folks to do this from now on instead of returning an object in your configuration callback (or even the
set*Directorymethods to programmatically set directories).Setting directories data cascade (order of precedence):
--input(overridesinputfrom any other methods)--output(overridesoutputfrom any other methods)dirproperty in return object from configuration callback (backwards compatibility)set*Directoryconfiguration API methods set*Directory Configuration API methods #1503configexport from configuration file with adirobject inside (this is the new thing)Examples
ESM
CommonJS
Update April 10: swapping this to be
configinstead ofdirectoriesso that it works the same as the current return object. Switch your return to namedconfigexport instead.