The "Build with Rollup" documentation is broken

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

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
48/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
nodejs, rollup

Hướng nghiên cứu

Mở phần «building-with-rollup» trong tài liệu Lit và so sánh ví dụ rollup.config.js của phần này với các lỗi đã được báo cáo của Node, @web/rollup-plugin-html, @rollup/plugin-terser và rollup-plugin-minify-html-literals. Tái hiện các hướng dẫn bằng Node v20.11.0 và npm 10.2.4, sau đó cập nhật cấu hình được ghi trong tài liệu để quá trình build hoàn tất mà không gặp các lỗi đó.

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

Mô tả

Which package(s) are affected?

Lit Core (lit / lit-html / lit-element / reactive-element)

Description

Trying to follow the instructions for building-with-rollup triggers multiple errors:

  1. "While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS file"
    Solution: Rename rollup.config.js to rollup.config.mjs

  2. "The requested module '@web/rollup-plugin-html' does not provide an export named 'default'"
    Solution:
    import { rollupPluginHTML as html } from "@web/rollup-plugin-html";

  3. The requested module '@rollup/plugin-terser' does not provide an export named 'terser'
    Solution:
    import terser from '@rollup/plugin-terser';

  4. TypeError: minifyHTML is not a function
    Solution:
    import pkgMinifyHTML from 'rollup-plugin-minify-html-literals';
    const minifyHTML = pkgMinifyHTML.default

Reproduction

Follow the instructions at building-with-rollup

Workaround

See above

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

2.x

Browser/OS/Node environment

node v20.11.0
npm 10.2.4

Ngôn ngữ chính
TypeScript
Star
140
Fork
229
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 lit/lit.dev

Tất cả issue của lit/lit.dev

Issue tương tự

Thêm issue về TypeScript

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.