Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing Webamp from bundle inside a module #1239

Open
msikma opened this issue Oct 30, 2023 · 0 comments
Open

Importing Webamp from bundle inside a module #1239

msikma opened this issue Oct 30, 2023 · 0 comments

Comments

@msikma
Copy link

msikma commented Oct 30, 2023

The readme mentions how to get started with Webamp in two situations: minimal, and with webpack.

As I mentioned on Discord, the example links are actually 404, so I'm not sure what they look like. But there's a tertiary option that might be mentioned: minimal, but with a <script type="module"> tag. In this case, you need to import() Webamp:

<script type="module">
await import('./webamp.bundle-1.5.0.js')

const container = document.querySelector('#container')
const webamp = new Webamp()
await webamp.renderWhenReady(container)
</script>

It might be worth mentioning this since it's otherwise not totally straightforward how to use the bundle file in an environment where a module is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant