Skip to content

Commit

Permalink
refactor: remove esbuild workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed May 12, 2023
1 parent 47b32ab commit f642aa3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export async function run(watch = process.argv.includes('start')) {
const LICENSE = await readFile(r('./LICENSE'), 'utf8')
await build({
entryPoints: files
.filter(x => x.endsWith('.js'))
.map(x => r(`./src/${x}`)),
.filter(file => file.endsWith('.js'))
.map(file => r(`./src/${file}`)),
outdir: '.',
banner: { js: `/**\n * @license\n${LICENSE}\n*/`, },
format: 'esm',
Expand Down
5 changes: 2 additions & 3 deletions src/slidem-deck.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ function isInInputLike(event) {
node.hasAttribute?.('contenteditable'));
}

// https://github.com/evanw/esbuild/issues/2800#issuecomment-1378198088
export const SlidemDeck = (() => class SlidemDeck extends HTMLElement {
export class SlidemDeck extends HTMLElement {
static is = 'slidem-deck';

/** @type {Set<SlidemDeck>} */
Expand Down Expand Up @@ -328,7 +327,7 @@ export const SlidemDeck = (() => class SlidemDeck extends HTMLElement {
this.#timerInterval = setInterval(() => (this.$.timer.innerText = SlidemDeck.#timer(begin)), 1000);
}
}
})();
}

SlidemDeck.initListeners();

Expand Down
4 changes: 2 additions & 2 deletions src/slidem-slide-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styleSheet from './slidem-slide-base.css' assert { type: 'css' };
import template from './slidem-slide-base.html' assert { type: 'html-template' };

// https://github.com/evanw/esbuild/issues/2800#issuecomment-1378198088
export const SlidemSlideBase = (() => class SlidemSlideBase extends HTMLElement {
export class SlidemSlideBase extends HTMLElement {
static observedAttributes = [
'auto',
'step',
Expand Down Expand Up @@ -122,4 +122,4 @@ export const SlidemSlideBase = (() => class SlidemSlideBase extends HTMLElement
this.$.content?.style?.setProperty('scale', 1);
}
}
})();
}
5 changes: 2 additions & 3 deletions src/slidem-slide.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SlidemSlideBase } from './slidem-slide-base.js';

// https://github.com/evanw/esbuild/issues/2800#issuecomment-1378198088
export const SlidemSlide = (() => class SlidemSlide extends SlidemSlideBase {
export class SlidemSlide extends SlidemSlideBase {
static is = 'slidem-slide';

static observedAttributes = [
Expand Down Expand Up @@ -91,6 +90,6 @@ export const SlidemSlide = (() => class SlidemSlide extends SlidemSlideBase {
}
}
}
})();
}

customElements.define(SlidemSlide.is, SlidemSlide);

0 comments on commit f642aa3

Please sign in to comment.