summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2026-01-04 21:47:21 -0800
committerElizabeth Hunt <me@liz.coffee>2026-01-04 21:52:40 -0800
commit7023dc1f29ff747a9d2fc3bf0cf0ec3fffacd0b1 (patch)
tree5f6d06d94d14d1c03996a0f517d5d3e86204996b
parentb449f76bc3f36525f37634a5d93f405b155f86d8 (diff)
downloadadelie-7023dc1f29ff747a9d2fc3bf0cf0ec3fffacd0b1.tar.gz
adelie-7023dc1f29ff747a9d2fc3bf0cf0ec3fffacd0b1.zip
Don't open serve
-rw-r--r--esbuild.config.js1
-rw-r--r--package.json2
-rw-r--r--src/ts/editor-standalone.ts9
3 files changed, 6 insertions, 6 deletions
diff --git a/esbuild.config.js b/esbuild.config.js
index ce5a36b..8c51c20 100644
--- a/esbuild.config.js
+++ b/esbuild.config.js
@@ -43,7 +43,6 @@ function buildEditor() {
sourcemap: true,
target: 'es2020',
format: 'iife',
- globalName: 'adelieEditor',
outfile: paths.outEditor,
logLevel: 'info',
});
diff --git a/package.json b/package.json
index 577d78d..a943b7f 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"build": "NODE_ENV=production node esbuild.config.js",
"dev": "node esbuild.config.js",
"clean": "rm -rf dist",
- "serve": "npx http-server dist -p 9000 -o",
+ "serve": "npx http-server dist -p 9000",
"dev:serve": "npm run dev && npm run serve",
"lint": "biome lint src",
"format": "biome format --write src",
diff --git a/src/ts/editor-standalone.ts b/src/ts/editor-standalone.ts
index 2c8ec81..2d4eab8 100644
--- a/src/ts/editor-standalone.ts
+++ b/src/ts/editor-standalone.ts
@@ -36,7 +36,7 @@ const adelieEditor = {
// Listen for theme changes
const observer = new MutationObserver((mutations) => {
- mutations.forEach((mutation) => {
+ for (const mutation of mutations) {
if (mutation.attributeName === 'data-theme') {
const newTheme =
document.documentElement.getAttribute('data-theme') === 'dark'
@@ -44,7 +44,7 @@ const adelieEditor = {
: 'light';
setEditorTheme(view, newTheme);
}
- });
+ }
});
observer.observe(document.documentElement, {
@@ -66,9 +66,10 @@ const adelieEditor = {
setTheme: setEditorTheme,
};
-// Export to window
+// Export to window and as default
if (typeof window !== 'undefined') {
- (window as any).adelieEditor = adelieEditor;
+ (window as unknown as Record<string, unknown>).adelieEditor = adelieEditor;
}
+// Also export for module systems
export default adelieEditor;