JSPM

astro-unminify-cloudflare

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q38330F
  • License MIT

Astro integration to unminify the generated Cloudflare worker.

Package Exports

  • astro-unminify-cloudflare
  • astro-unminify-cloudflare/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (astro-unminify-cloudflare) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

astro-unminify-cloudflare

Astro integration to unminify the generated Cloudflare worker.

The Astro Cloudflare integration minifies the generated worker.js file by default depending on the global vite configuration. This causes some issues:

  • Deployments sometimes fail with no apparent reason.
  • Any stack traces from errors become useless if the code is compiled.
  • Globally disabling minification also affects client scripts, significantly increasing their size and preventing the usual framework optimizations.

This integration disables minification only for the server-side, preserving all critical optimizations for the client. This approach maintains the benefits of having a plain file that can be easily deployed to Cloudflare Pages, while avoiding the aforementioned issues.

Install

npm astro add astro-unminify-cloudflare