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(
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),

View File

@ -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")
),