Fix path to compiled CLI elm.

This commit is contained in:
Dillon Kearns 2023-01-25 09:00:19 -08:00
parent d4a8342888
commit 71bd580f98
2 changed files with 4 additions and 4 deletions

View File

@ -13,11 +13,11 @@ export default async function run({
fs.copyFileSync( fs.copyFileSync(
renderFunctionFilePath, renderFunctionFilePath,
"./functions/render/elm-pages-cli.js" "./functions/render/elm-pages-cli.cjs"
); );
fs.copyFileSync( fs.copyFileSync(
renderFunctionFilePath, renderFunctionFilePath,
"./functions/server-render/elm-pages-cli.js" "./functions/server-render/elm-pages-cli.cjs"
); );
fs.copyFileSync(portsFilePath, "./functions/render/custom-backend-task.mjs"); fs.copyFileSync(portsFilePath, "./functions/render/custom-backend-task.mjs");
fs.copyFileSync( fs.copyFileSync(
@ -138,7 +138,7 @@ async function render(event, context) {
const renderResult = await renderer.render( const renderResult = await renderer.render(
compiledPortsFile, compiledPortsFile,
basePath, basePath,
(await import("./elm-pages-cli.js")).default, (await import("./elm-pages-cli.cjs")).default,
mode, mode,
event.path, event.path,
await reqToJson(event, requestTime), await reqToJson(event, requestTime),

View File

@ -618,7 +618,7 @@ function _HtmlAsJson_toJson(html) {
async function runAdapter(adaptFn, processedIndexTemplate) { async function runAdapter(adaptFn, processedIndexTemplate) {
try { try {
await adaptFn({ await adaptFn({
renderFunctionFilePath: "./elm-stuff/elm-pages/elm.js", renderFunctionFilePath: "./elm-stuff/elm-pages/elm.cjs",
routePatterns: JSON.parse( routePatterns: JSON.parse(
await fsPromises.readFile("./dist/route-patterns.json", "utf-8") await fsPromises.readFile("./dist/route-patterns.json", "utf-8")
), ),