mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-27 22:01:48 +03:00
Support missing custom-backend-task file in script bundle and run commands.
This commit is contained in:
parent
2e47866cb0
commit
3ef54d6275
@ -176,7 +176,9 @@ async function main() {
|
|||||||
);
|
);
|
||||||
await renderer.runGenerator(
|
await renderer.runGenerator(
|
||||||
unprocessedCliOptions,
|
unprocessedCliOptions,
|
||||||
await import(url.pathToFileURL(path.resolve(portsPath)).href),
|
portsPath
|
||||||
|
? await import(url.pathToFileURL(path.resolve(portsPath)).href)
|
||||||
|
: null,
|
||||||
await requireElm("./script/elm-stuff/elm-pages/elm.cjs"),
|
await requireElm("./script/elm-stuff/elm-pages/elm.cjs"),
|
||||||
moduleName
|
moduleName
|
||||||
);
|
);
|
||||||
@ -249,9 +251,17 @@ async function main() {
|
|||||||
"./script/elm-stuff/elm-pages/elm.js",
|
"./script/elm-stuff/elm-pages/elm.js",
|
||||||
"./script/elm-stuff/elm-pages/elm.cjs"
|
"./script/elm-stuff/elm-pages/elm.cjs"
|
||||||
);
|
);
|
||||||
const scriptRunner = `import * as customBackendTask from "${path.resolve(
|
// TODO allow no custom-backend-task
|
||||||
"./custom-backend-task.ts"
|
const portBackendTaskFileFound =
|
||||||
)}";
|
globbySync("./custom-backend-task.*").length > 0;
|
||||||
|
|
||||||
|
const scriptRunner = `${
|
||||||
|
portBackendTaskFileFound
|
||||||
|
? `import * as customBackendTask from "${path.resolve(
|
||||||
|
"./custom-backend-task"
|
||||||
|
)}";`
|
||||||
|
: "const customBackendTask = {};"
|
||||||
|
}
|
||||||
import * as renderer from "./render.js";
|
import * as renderer from "./render.js";
|
||||||
import { default as Elm } from "${path.resolve(
|
import { default as Elm } from "${path.resolve(
|
||||||
"./script/elm-stuff/elm-pages/elm.cjs"
|
"./script/elm-stuff/elm-pages/elm.cjs"
|
||||||
|
Loading…
Reference in New Issue
Block a user