diff options
Diffstat (limited to 'src/write/build-modes')
-rw-r--r-- | src/write/build-modes/live-dev-server.js | 21 | ||||
-rw-r--r-- | src/write/build-modes/static-build.js | 21 |
2 files changed, 26 insertions, 16 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js index fe627f6f..c855533b 100644 --- a/src/write/build-modes/live-dev-server.js +++ b/src/write/build-modes/live-dev-server.js @@ -332,6 +332,17 @@ export async function go({ // Other routes determined by page and URL specs + const commonUtilities = { + defaultLanguage, + getSizeOfAdditionalFile, + getSizeOfImagePath, + languages, + missingImagePaths, + thumbsCache, + urls, + wikiData, + }; + const startTiming = () => { if (!showTimings) { return () => ''; @@ -417,19 +428,13 @@ export async function go({ const timing = startTiming(); const bound = bindUtilities({ + ...commonUtilities, + absoluteTo, - defaultLanguage, - getSizeOfAdditionalFile, - getSizeOfImagePath, language, - languages, - missingImagePaths, pagePath: servePath, pagePathStringFromRoot: pathname.replace(/^\//, ''), - thumbsCache, to, - urls, - wikiData, }); const topLevelResult = diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js index c50db6b8..d743a64b 100644 --- a/src/write/build-modes/static-build.js +++ b/src/write/build-modes/static-build.js @@ -288,6 +288,17 @@ export async function go({ showAggregate: niceShowAggregate, }); + const commonUtilities = { + defaultLanguage, + getSizeOfAdditionalFile, + getSizeOfImagePath, + languages, + missingImagePaths, + thumbsCache, + urls, + wikiData, + }; + const perLanguageFn = async (language, i, entries) => { const baseDirectory = language === defaultLanguage ? '' : language.code; @@ -316,19 +327,13 @@ export async function go({ }); const bound = bindUtilities({ + ...commonUtilities, + absoluteTo, - defaultLanguage, - getSizeOfAdditionalFile, - getSizeOfImagePath, language, - languages, - missingImagePaths, pagePath, pagePathStringFromRoot: pathname, - thumbsCache, to, - urls, - wikiData, }); let pageHTML, oEmbedJSON; |