Include new function in default config.

This commit is contained in:
Dillon Kearns 2022-11-02 14:51:02 +05:30
parent 9aa446e963
commit 7c229cc88a

View File

@ -1,7 +1,9 @@
const path = require("path");
async function resolveConfig() {
return await import(path.join(process.cwd(), "elm-pages.config.mjs"))
const initialConfig = await await import(
path.join(process.cwd(), "elm-pages.config.mjs")
)
.then(async (elmPagesConfig) => {
return (
elmPagesConfig.default || {
@ -18,6 +20,15 @@ async function resolveConfig() {
vite: {},
};
});
return {
preloadTagForFile: function () {
return true;
},
headTagsTemplate: defaultHeadTagsTemplate,
vite: {},
...initialConfig,
};
}
function defaultHeadTagsTemplate(context) {