feat: add display kiosk host
This commit is contained in:
@@ -41,14 +41,17 @@ const buildOptions = {
|
||||
// React reads this at module scope and a browser has no `process`.
|
||||
"process.env.NODE_ENV": JSON.stringify(serve ? "development" : "production"),
|
||||
},
|
||||
entryPoints: [path.join(packageDirectory, "src", "browser", "main.tsx")],
|
||||
entryPoints: {
|
||||
app: path.join(packageDirectory, "src", "browser", "main.tsx"),
|
||||
"display/app": path.join(packageDirectory, "src", "display", "main.tsx"),
|
||||
},
|
||||
format: "esm",
|
||||
jsx: "automatic",
|
||||
logLevel: "info",
|
||||
// Unminified, matching the module UI build: an operator is expected to be able to read what their
|
||||
// installation actually serves, and nothing else in this repository minifies.
|
||||
minify: false,
|
||||
outfile: path.join(outputDirectory, "app.js"),
|
||||
outdir: outputDirectory,
|
||||
platform: "browser",
|
||||
sourcemap: true,
|
||||
// Matches `browser.json`'s `target`, so what TypeScript typechecks and what esbuild emits agree.
|
||||
@@ -57,7 +60,12 @@ const buildOptions = {
|
||||
|
||||
await rm(outputDirectory, { force: true, recursive: true });
|
||||
await mkdir(outputDirectory, { recursive: true });
|
||||
await mkdir(path.join(outputDirectory, "display"), { recursive: true });
|
||||
await copyFile(path.join(packageDirectory, "index.html"), path.join(outputDirectory, "index.html"));
|
||||
await copyFile(
|
||||
path.join(packageDirectory, "display.html"),
|
||||
path.join(outputDirectory, "display", "index.html"),
|
||||
);
|
||||
|
||||
if (serve) {
|
||||
const context = await esbuild.context(buildOptions);
|
||||
|
||||
Reference in New Issue
Block a user