mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 14:34:18 +03:00
Add prototype file for compiling elm module from NodeJS.
This commit is contained in:
parent
62cd55d076
commit
21a7d1160e
12
compile-elm.js
Normal file
12
compile-elm.js
Normal file
@ -0,0 +1,12 @@
|
||||
var compile = require("node-elm-compiler").compile;
|
||||
var compileToString = require("node-elm-compiler").compileToString;
|
||||
|
||||
process.chdir("./examples/docs/");
|
||||
compileToString(["./src/Main.elm"], {}).then(function(data) {
|
||||
eval(data.toString());
|
||||
const app = Elm.Main.init({ flags: { imageAssets: {} } });
|
||||
|
||||
app.ports.toJsPort.subscribe(payload => {
|
||||
console.log("payload", payload);
|
||||
});
|
||||
});
|
@ -26,7 +26,7 @@
|
||||
"glob": "^7.1.4",
|
||||
"gray-matter": "^4.0.2",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"node-elm-compiler": "^5.0.3",
|
||||
"node-elm-compiler": "^5.0.4",
|
||||
"prerender-spa-plugin": "^3.4.0",
|
||||
"sass-loader": "^7.2.0",
|
||||
"style-loader": "^1.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user