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

--format=modern still converts modern JS to old-style JS?

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

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, rollup
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Tái hiện vấn đề bằng lệnh microbundle watch được hiển thị, sử dụng src/react-app/ui.js và kiểm tra public/preact-ui.js. Theo dõi cách --format=modern được xử lý và xác minh rằng đầu ra modern vẫn giữ nguyên cú pháp class, async function, let và arrow được thể hiện trong đầu vào.

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

Mô tả

I was trying to figure out why my code was doing the wrong thing, and ran into the fact that using --format=modern still seems to yield legacy JS:

> microbundle watch -i ./src/react-app/ui.js -o ./public/preact-ui.js --format=modern --no-sourcemap --no-compress

turned the following:

class MJUI extends Component {
  constructor(props) {
    // ...
  }

  renderGames(state) {
    return state.games.map((g) => {
      if (g.finished) return;

      let joinOrStart = async () => {
        // Note that these two operations are mutually
        // exclusive, because owner's can't join, and
        // non-owners can't start a game:
        this.server.game.join(g.name);
        this.server.game.start(g.name);
      };

      // ...
    });
  }

  // ...
}

into:

  // ...

  renderGames(state) {
    var _this = this;

    return state.games.map(g => {
      if (g.finished) return;

      let joinOrStart = async function joinOrStart() {
        // Note that these two operations are mutually
        // exclusive, because owner's can't join, and
        // non-owners can't start a game:
        _this.server.game.join(g.name);

        _this.server.game.start(g.name);
      };

  // ...

Note that the filename has the .modern.js suffix, so something feels rather off?

Ngôn ngữ chính
JavaScript
Star
8.1k
Fork
358
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 developit/microbundle

Tất cả issue của developit/microbundle

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.