mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 23:06:10 +03:00
Hardcode some parameters that shouldn't change.
This commit is contained in:
parent
713d9f0690
commit
07152b8fa3
@ -1,22 +1,18 @@
|
||||
const { compileToString } = require("node-elm-compiler");
|
||||
|
||||
module.exports = runElm;
|
||||
function runElm(elmBaseDirectory, callback) {
|
||||
function runElm(callback) {
|
||||
const elmBaseDirectory = "./elm-stuff/elm-pages";
|
||||
const mainElmFile = "../../src/Main.elm";
|
||||
const startingDir = process.cwd();
|
||||
console.log("cwd", process.cwd());
|
||||
process.chdir(elmBaseDirectory);
|
||||
console.log("cwd", process.cwd());
|
||||
compileToString(["./src/Main.elm"], {}).then(function(data) {
|
||||
compileToString([mainElmFile], {}).then(function(data) {
|
||||
eval(data.toString());
|
||||
const app = Elm.Main.init({ flags: { imageAssets: {} } });
|
||||
|
||||
app.ports.toJsPort.subscribe(payload => {
|
||||
console.log("payload", payload);
|
||||
callback(payload);
|
||||
process.chdir(startingDir);
|
||||
console.log("cwd", process.cwd());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// runElm("./examples/docs/", function() {});
|
||||
|
Loading…
Reference in New Issue
Block a user