Closed max-lt closed 2 years ago
Hey @max-lt! Def appreciate the suggestion, and you're not alone (unfortunately). I think the change you suggest would be a break for people using standard require
(CommonJS modules without a bundler), so the solution seems to be a hybrid module (one export for CommonJS, one for ES modules)... I'm about to be out on a climb for a few weeks, so I'll have to tackle this once I return mid-January!
Should be considered closed with upcoming release...
Hello, I loved using itty-router with Cloudflare workers, I'd like to make it work with Deno/Deno Deploy workers too; there is almost no changes to apply as it already works with it (see below)
To only probem is about the module export, "module" is not defined in the deno runtime as the module system differs a bit, I removed the
module.exports = { Router }
(last line) and set the first line as follows :It works like a charm as is. I don't know what this change would imply for the package but it should be ok as webpack can import such modules.