Rollup build pipeline is broken
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 142
- Forks
- 230
- PR merge metrics
- No merged PRs in 30d
Description
### Which package(s) are affected?
Other/unknown (please mention in description)
### Description
I've created a fresh new Lit project with Vite but unable to set environment to build HTML bundle with Rollup.
I repeated exactly as written in Lit documentation.
According to [Lit docs](https://lit.dev/docs/tools/production/#modern-only-build) Rollup packages should be installed but there are few problems:
1) Installation of `rollup-plugin-minify-html-literals` package fails because dependency tree can't be resolved
```
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: lit-ts-tmp@0.0.0
npm ERR! Found: rollup@3.20.7
npm ERR! node_modules/rollup
npm ERR! dev rollup@"^3.20.7" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@"^0.65.2 || ^1.0.0 || ^2.0.0" from rollup-plugin-minify-html-literals@1.2.6
npm ERR! node_modules/rollup-plugin-minify-html-literals
npm ERR! dev rollup-plugin-minify-html-literals@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/mike/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mike/.npm/_logs/2023-04-21T16_53_26_092Z-debug-0.log
```
2) If I skip HTML minification and drop out `rollup-plugin-minify-html-literals` package Rollup also fails to build the project
`$ npx rollup -c`
Result:
`[!] SyntaxError: The requested module '@web/rollup-plugin-html' does not provide an export named 'default'`
---
So that for now I can't move forward with my Lit project since there are some flaws with dependency tree and no alternative example provided in the docs.
Any working and comprehensive code sample how to build HTML bundle with Lit will be appreciated!
### Reproduction
1) At first create a new Lit project with Vite `npm create vite@latest`
2) Try to install all these dependencies which shown in the official [Lit docs](https://lit.dev/docs/tools/production/#modern-only-build)
3) Rollup environment setup fails
### Workaround
No workaround found, unfortunately.
### Is this a regression?
No or unsure. This never worked, or I haven't tried before.
### Affected versions
lit@2.7.2
### Browser/OS/Node environment
macOS: 10.15.7
Node: v16.14.2
npm: 8.5.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by following the modern-only build instructions at the linked Lit documentation, reproducing the npm installation failure and then running `npx rollup -c` without `rollup-plugin-minify-html-literals`. Check whether the documented Rollup package versions and `@web/rollup-plugin-html` configuration are compatible; done means the docs provide a working HTML-bundle setup for a fresh Vite project.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rollup, typescript, vite
- Domain
- build-system, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100