Skip to content

Instantly share code, notes, and snippets.

@PhoneDroid
Created February 19, 2024 02:58
Show Gist options
  • Select an option

  • Save PhoneDroid/bb03f9b60fc2ac354cb84c06450de1ed to your computer and use it in GitHub Desktop.

Select an option

Save PhoneDroid/bb03f9b60fc2ac354cb84c06450de1ed to your computer and use it in GitHub Desktop.

For some reason I can never find this anything about this, so here so I don't forget.

SomeElement.ts

declare class Class extends HTMLElement {
    constructor ()
}


declare global {
    var SomeElement : typeof Class
}

tsconfig.json

{
    "compilerOptions" : {
        "paths" : {
            "CustomElement" : [ "./CustomElement/mod" ] ,
        }
    }
}

Build.sh

bun build                      \
    --external "CustomElement" \
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment