Re:Run JavaScript on Cloudflare with Workers
by thepumpkin1979 on Tuesday March 13, 2018 @09:40AM
(#16575979)
Congrats, this is really great. Question, since it’s not based on Node.js there is no way to leverage on a regular package manager, how can I create reusable code between edge workers? How can I make an open source snippet without copy and paste?
[ Parent
| on HN ]
Re:Run JavaScript on Cloudflare with Workers
by kentonv on Tuesday March 13, 2018 @09:47AM
(#16576021)
For now, I recommend thinking of Workers like you do browsers: Use Webpack or Browserify or one of the many other tools to transpile npm packages into a single script, then upload that to Cloudflare using the API.
Meanwhile now that the base product is out we will be spending more time improving the tooling, and integrating with Cloudflare Apps so that you can package (and sell) Workers for other people to use on their own sites.
Re:Run JavaScript on Cloudflare with Workers
by JohnDotAwesome on Tuesday March 13, 2018 @09:45AM
(#16576010)
The short answer is webpack!
The long answer is webpack, rollup, or browserify :)