Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Rollup Support #1287

Closed
wtcross opened this issue May 15, 2020 · 7 comments
Closed

Rollup Support #1287

wtcross opened this issue May 15, 2020 · 7 comments

Comments

@wtcross
Copy link

wtcross commented May 15, 2020

💡 Feature request

Overview and problem statement

It would be great for Wrangler to support Rollup for module bundling in addition to Webpack. The wasm module for Rollup enables importing and bundling wasm modules. With my limited understanding of Wrangler internals I think this would enable supporting Rollup as well.

Basic example

The svelte-ssr-worker project by @lukeed is a great example of a project that could benefit from this.

@xtuc
Copy link
Member

xtuc commented May 15, 2020

Similar report #1274. To echo what I said, I think it's certainly possible to support mutliple bundlers, it's just not on our TODO list at the moment.

@wtcross
Copy link
Author

wtcross commented May 15, 2020

Thanks for the quick response. Webpack accomplishes all the same things so I would also categorize this as low priority. This would be more of a refinement down the road I suppose.

@ashleymichal ashleymichal added this to the wrangler build milestone May 15, 2020
@wtcross
Copy link
Author

wtcross commented May 17, 2020

I created an example similar to the svelte-ssr-worker project I previously linked to that uses Webpack instead of Rollup to accomplish the same goal.

https://github.com/wtcross/svelte-ssr-cloudflare-worker-site

Note the need to wrap wrangler with NPM scripts since it's a multi-phased build (client → ssr → worker).

@PierBover
Copy link

Is it not possible to bundle a Worker project to a single .js file with Rollup and then in wrangler.toml just use type = "javascript"?

Am I missing something?

@wtcross
Copy link
Author

wtcross commented May 19, 2020

@PierBover as far as I can tell it forces a webpack build even if type = "javascript" is used. That's probably a separate issue.

@wtcross wtcross closed this as completed May 19, 2020
@EverlastingBugstopper
Copy link
Contributor

mmmmm - definitely should not be running webpack at all if you set type = "javascript". if it is, that's a bug.

@PierBover
Copy link

I haven't seen that either. And I even used Rollup to bundle a worker (or at least I tested it).

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

No branches or pull requests

5 participants