mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-05 02:24:28 +03:00
Import user-index in example.
This commit is contained in:
parent
094f108890
commit
4137773928
@ -1,6 +1,7 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
// const { Elm } = require("./src/Main.elm");
|
// const { Elm } = require("./src/Main.elm");
|
||||||
import { Elm } from "/main.js";
|
import { Elm } from "/main.js";
|
||||||
|
import userInit from "/user-index.js";
|
||||||
// const pagesInit = require("../../index.js");
|
// const pagesInit = require("../../index.js");
|
||||||
|
|
||||||
let prefetchedPages;
|
let prefetchedPages;
|
||||||
@ -159,9 +160,11 @@ function httpGet(/** @type string */ theUrl) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pagesInit({
|
userInit(
|
||||||
mainElmModule: Elm.Main,
|
pagesInit({
|
||||||
});
|
mainElmModule: Elm.Main,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// function pagesInit(config) {
|
// function pagesInit(config) {
|
||||||
// const path = window.location.pathname.replace(/(\w)$/, "$1/");
|
// const path = window.location.pathname.replace(/(\w)$/, "$1/");
|
||||||
|
9
examples/simple/user-index.js
Normal file
9
examples/simple/user-index.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
export default function (elmLoaded) {
|
||||||
|
console.log("Hello outside of promise!");
|
||||||
|
elmLoaded.then((elmPagesApp) => {
|
||||||
|
console.log("Inside of promise");
|
||||||
|
elmPagesApp.ports.example.subscribe((message) => {
|
||||||
|
console.log("Elm port message: ", message);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
@ -129,6 +129,7 @@ async function runTerser(filePath) {
|
|||||||
|
|
||||||
async function copyAssets() {
|
async function copyAssets() {
|
||||||
fs.copyFile("index.js", "dist/index.js");
|
fs.copyFile("index.js", "dist/index.js");
|
||||||
|
fs.copyFile("user-index.js", "dist/user-index.js");
|
||||||
fs.copyFile("style.css", "dist/style.css");
|
fs.copyFile("style.css", "dist/style.css");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user