Skip to content

[ENHANCEMENT] Publish package as standard JS modules #712

Open
@justinfagnani

Description

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

This package is currently published as CommonJS modules only. This makes it impossible to use in browsers and other environments that don't support Common JS, without a build step.

Expected Behavior

This should just work with a suitable import map:

import semver from 'semver';

This could be done as part of a migration to standard JS modules only, or a dual-mode package, possibly as part of #498

Steps To Reproduce

  1. In a browser
  2. With dev server that can rewrite bare module specifiers to URLs (such as @web/dev-server with the --node-resolve flag)
  3. Load a module script with import semver from 'semver';
  4. See error...

Environment

  • npm:
  • Node:
  • OS:
  • platform: All browsers, Cloudflare Workers, more...

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds an initial review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions