https://github.com/indaco/vitepress-templ-preview
A VitePress plugin to preview your templ components while documenting them.
https://github.com/indaco/vitepress-templ-preview
components go golang previewer templ vitepress-plugin
Last synced: 10 months ago
JSON representation
A VitePress plugin to preview your templ components while documenting them.
- Host: GitHub
- URL: https://github.com/indaco/vitepress-templ-preview
- Owner: indaco
- License: other
- Created: 2024-06-24T06:37:52.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-01T04:41:54.000Z (over 1 year ago)
- Last Synced: 2025-03-12T20:41:44.789Z (over 1 year ago)
- Topics: components, go, golang, previewer, templ, vitepress-plugin
- Language: TypeScript
- Homepage: https://vitepress-templ-preview.indaco.dev/
- Size: 9.22 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
vitepress-templ-preview
A VitePress plugin to preview your templ components while documenting them.
## Documentation
Check out the docs [here](https://vitepress-templ-preview.indaco.dev).
## Contributing
We welcome contributions! Whether it's reporting a bug, suggesting a feature, or submitting a pull request, your input helps improve this project.
### Known Issues
When running `pnpm web:dev` to start the sample website, you might encounter the following error:
```bash
> vitepress dev docs
failed to load config from /vitepress-templ-preview/website/docs/.vitepress/config.mts
failed to start server. error:
Cannot find module '../data/patch.json'
```
**Cause**
This issue is related to the `css-tree` package. The root cause seems to stem from how module exports are defined in its package.json.
**Workaround**
You can resolve this issue by modifying the exports field in node_modules/css-tree/package.json. Specifically, update the first exports entry like so:
```json
"exports": {
".": {
- "import": "./lib/index.js",
+ "import": "./cjs/index.cjs",
"require": "./cjs/index.cjs"
},
...
```
This workaround was discussed in [bun/issues/13076](https://github.com/oven-sh/bun/issues/13076#issuecomment-2550735879).
**Note**
While this is a temporary fix, keep an eye on updates to css-tree or related dependencies for a permanent resolution. If you encounter additional issues or have insights into fixing this differently, feel free to open an issue!
## License
This project is licensed under the MIT License - see the LICENSE file for details.
### Acknowledgements
This project makes use of [static-templ](https://github.com/nokacper24/static-templ), which is licensed under the GNU General Public License (GPL). Users of this project must comply with the terms of the GPL license when using static-templ. Refer to the [static-templ repository](https://github.com/nokacper24/static-templ) for more information on its licensing terms.