Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[ENHANCEMENT] Publish package as standard JS modules

Đang mở
#712 13 bình luận 20 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
tooling

Hướng nghiên cứu

Read the existing issue discussion and the related node-semver issue #498 before investigating the package's current CommonJS publication setup. Verify the chosen migration or dual-mode approach by testing the issue's browser import scenario; done means import semver from 'semver' works through a suitable import map without a build step.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug Needs Triage
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 https://github.com/npm/node-semver/issues/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...
Ngôn ngữ chính
JavaScript
Star
5.5k
Fork
598
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của npm/node-semver

Tất cả issue của npm/node-semver

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.