From 71bd580f989d7cbf6a2f026f957e0252f111fbae Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Wed, 25 Jan 2023 09:00:19 -0800 Subject: [PATCH] Fix path to compiled CLI elm. --- examples/pokedex/adapter.mjs | 6 +++--- generator/src/build.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pokedex/adapter.mjs b/examples/pokedex/adapter.mjs index c05d2ec9..97a96b9d 100644 --- a/examples/pokedex/adapter.mjs +++ b/examples/pokedex/adapter.mjs @@ -13,11 +13,11 @@ export default async function run({ fs.copyFileSync( renderFunctionFilePath, - "./functions/render/elm-pages-cli.js" + "./functions/render/elm-pages-cli.cjs" ); fs.copyFileSync( 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( @@ -138,7 +138,7 @@ async function render(event, context) { const renderResult = await renderer.render( compiledPortsFile, basePath, - (await import("./elm-pages-cli.js")).default, + (await import("./elm-pages-cli.cjs")).default, mode, event.path, await reqToJson(event, requestTime), diff --git a/generator/src/build.js b/generator/src/build.js index 2a9d964e..30df4dcd 100755 --- a/generator/src/build.js +++ b/generator/src/build.js @@ -618,7 +618,7 @@ function _HtmlAsJson_toJson(html) { async function runAdapter(adaptFn, processedIndexTemplate) { try { await adaptFn({ - renderFunctionFilePath: "./elm-stuff/elm-pages/elm.js", + renderFunctionFilePath: "./elm-stuff/elm-pages/elm.cjs", routePatterns: JSON.parse( await fsPromises.readFile("./dist/route-patterns.json", "utf-8") ),