Feature: Example of Vite config to fully bundle lexical+plugins+react into a JS and a CSS file
- Dominant language
- TypeScript
- Stars
- 23.9k
- Forks
- 2.2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 61
Description
I'm developing a single-file HTML app (for ease of distribution and drop-in) which needs a rich-text editor. I'm currently using Lexical for this purpose.
Extracting one of asks from https://github.com/facebook/lexical/issues/5840, for non-webdevs like me, it would be greate to have an example of Vite config bundling Lexical+Plugins+React into:
1) one JS and one CSS file - e.g. for deployment to GitHub pages (the existing vite config produces many CSS/font/image/JS files)
2) the JS/CSS should be fully embeddable in `...` and `...` and it should be possible to somehow register a Promise to be triggered when initialization of the editor completes (and ideally also a synchronous initialization should be supported)
Am I correct that (1) should already be achievable in https://vitejs.dev/guide/build#library-mode ?
Contributor guide
Research direction
Review the existing Vite configuration and the Vite library-mode guide linked in the issue. Determine how to produce one embeddable JavaScript file and one CSS file for Lexical, its plugins, and React, including completion signaling; done means a documented example that works for the stated single-file HTML deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, vite
- Domain
- build-system, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100