diff --git a/pug/defaults.js b/pug/defaults.js index 0522098..90f81e2 100644 --- a/pug/defaults.js +++ b/pug/defaults.js @@ -13,9 +13,10 @@ export const DEFAULT_PUG_OPTIONS = { /** * The root directory of all absolute inclusion. - * @type {String} + * @type {String|undefined} + * @default undefined */ - basedir: '.', + basedir: undefined, /** * If the doctype is not specified as part of the template, you can specify it here. diff --git a/pug/extension.js b/pug/extension.js index 50da72d..09fe1a3 100644 --- a/pug/extension.js +++ b/pug/extension.js @@ -44,13 +44,20 @@ const extension = { debugDev('rendering... received arg: %O', arg) debug( 'about to render... inputPath: %O', inputPath) - // TODO: clean up the setup and updating of options const renderOptions = Object.assign( {}, { - basedir: arg.eleventy.directories.includes, + basedir: extension.options.basedir ?? arg.eleventy.directories.includes, filename: inputPath, filters: extension.options.filters, + doctype: extension.options.doctype, + pretty: extension.options.pretty, + self: extension.options.self, + debug: extension.options.debug, + compileDebug: extension.options.compileDebug, + globals: extension.options.globals, + cache: extension.options.cache, + inlineRuntimeFunctions: extension.options.inlineRuntimeFunctions, }, arg )