lit / lit.dev

The Lit website
https://lit.dev
BSD 3-Clause "New" or "Revised" License
117 stars 174 forks source link

The "Build with Rollup" documentation is broken #1304

Open tournesolo opened 7 months ago

tournesolo commented 7 months ago

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

augustjk commented 7 months ago

Thank you for the report! Transferred issue to the lit.dev repo as this is a documentation issue.