diff --git a/generator/src/compile-elm.js b/generator/src/compile-elm.js index 112a835b..67743ff9 100644 --- a/generator/src/compile-elm.js +++ b/generator/src/compile-elm.js @@ -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() {});