Skip to content

HTTP imports for third party libraries #74

@RayyanNafees

Description

@RayyanNafees

It would be great if we could import third party libraries into the playground

Like this

import kebabCase from 'https://esm.sh/kebab-case'

add([
    text(kebabCase("Hello World")),
    pos(center()) 
])

The only way to do so for now in the playground seems to be

import('https://unpkg.com/kebab-case')
.then(k=>k.default)
.then(kebab=>{
    add([
        text(kebab('Hello World')),
        pos(center()) 
    ])
})

Any way I can preload them before the game starts ? Using load function did not work in the below example

const kebab = load(import('https://unpkg.com/kebab-case').then(k=>k.default))

add([
     text(kebab.data('Hello World')),
     pos(center())  
])

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions