Skip to content

Unable to use via ESM CDN like JSDelivr or JSPM #153

Description

@abhishiv

On JSDelivr it fails due to hard dependency on fs

await import("https://cdn.jsdelivr.net/npm/postcss-modules/+esm")
+esm:7 Uncaught Error: Failed to bundle using Rollup v2.79.1: the file imports a not supported node.js built-in module "fs". If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr

On JSPM which doesn't mind dependency to fs and can load postcss and sass due to it it fails due to an error in loader-utils subdepenendency.

await import('https://jspm.dev/postcss-modules');

npm:generic-names@4!cjs:1     GET https://jspm.dev/npm:loader-utils@3/lib/interpolateName!cjs net::ERR_ABORTED 404
Uncaught TypeError: Failed to fetch dynamically imported module: https://jspm.dev/postcss-modules

It would be really great to have it working at least on JSPM so that there's a way to bundle css modules in the browser using ESM/ImportMaps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions