Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions
- The personal page loads faster and costs the router less: its script and styles come compressed, stay in the browser until the next update, and the icon comes with the page instead of a request of its own - The page uses the system's own font (SF Pro on Apple devices, Segoe UI on Windows, Roboto on Android) instead of downloading one - The top of the page shows the server's name alone, so it fits on a phone - Text can be selected only where it is there to be copied (addresses, file names, the configuration), with the name field's own selection: a soft highlight with handles that glides after the pointer - Sheets scroll without a scrollbar - Red buttons (Remove) light up under the pointer, as the others do - Demo: "Demo" and GitHub are one button; on a phone it floats at the bottom of the screen, and switching scenarios no longer makes the edge fades jump
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { defineConfig } from 'tsup';
|
|
import { build } from 'esbuild';
|
|
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { poCatalog } from './tsup.config';
|
|
|
|
// The portal demo: a static site in dist/demo (vercel.json deploys it). The
|
|
// real portal with the demo's router in the page (src/portal/demo); its
|
|
// stylesheet is the portal's plus the demo's pieces, its shell is portal.uc's.
|
|
const OUT = 'dist/demo';
|
|
|
|
export default defineConfig({
|
|
entry: { portal: 'src/portal/demo/main.ts' },
|
|
format: ['iife'],
|
|
outDir: OUT,
|
|
outExtension: () => ({ js: '.js' }),
|
|
target: 'es2019',
|
|
// Not cleaned: the folder may hold Vercel's project link (.vercel).
|
|
clean: false,
|
|
sourcemap: false,
|
|
minify: true,
|
|
noExternal: ['qrcode-generator'],
|
|
esbuildPlugins: [poCatalog],
|
|
esbuildOptions(o) {
|
|
o.legalComments = 'none';
|
|
o.charset = 'utf8';
|
|
},
|
|
onSuccess: async () => {
|
|
const css = await build({
|
|
entryPoints: ['src/portal/demo/demo.css'],
|
|
bundle: true,
|
|
minify: true,
|
|
write: false,
|
|
legalComments: 'none',
|
|
logLevel: 'silent',
|
|
});
|
|
fs.writeFileSync(path.join(OUT, 'portal.css'), css.outputFiles[0].text.trim() + '\n');
|
|
fs.copyFileSync('src/portal/demo/index.html', path.join(OUT, 'index.html'));
|
|
fs.copyFileSync('src/portal/icon.svg', path.join(OUT, 'icon.svg'));
|
|
},
|
|
});
|