google / google/playground-elements

esbuild configuration: webworker support

Open
#335 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
648
Forks
61
PR merge metrics
No merged PRs in 30d

Description

I'm trying to get an [11ty](https://www.11ty.dev) with [esbuild](https://esbuild.github.io) structure setup to use playground-elements in a component-library monorepo and am struggling to get esbuild to work.

I get the _"Failed to construct 'URL'"_ error and struggled to figure this out for a couple hours until I finally found the Bundling documentation where it calls out the file in question within the [Other section](https://github.com/google/playground-elements#other). I updated my esbuild config to include the file in question via:

```js
config.addPassthroughCopy({ "node_modules/playground-elements/playground-typescript-worker.js": "playground-typescript-worker.js" })
```

It's in the same directory as my `main.js` file but I'm still getting the error.

When I noticed that webpack 5 has worker support builtin I thought I'd check esbuild and found [this web worker issue](https://github.com/evanw/esbuild/issues/312). I don't see any resolution in there and not sure if there's something else I should be doing or if esbuild isn't compatible at this time.

If anyone has any advice it'd be greatly appreciated.

Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.