Overview
The “vite-plugin-document” npm package is a plugin that allows you to use a Document.tsx file as an HTML template. It provides options for customizing the filepath and bundling the Document.tsx file into the disk. It is built with solidjs framework and can automatically detect solidjs if the “vite-plugin-solid” is found in the vite plugins list.
Features
- Allows you to use a Document.tsx file as an HTML template
- Provides options to customize the filepath and output directory
- Built with the solidjs framework
- Automatically detects solidjs if “vite-plugin-solid” is present in vite plugins list
Installation
To install the vite-plugin-document package, follow these steps:
- Create a “src/Document.tsx” file.
- Add the following code to the “Document.tsx” file:
// code snippet here
- Check the playground for more details.
- Install the package using the following command:
pnpm i vite-plugin-document
Summary
The vite-plugin-document npm package is a useful plugin for Vite projects that allows you to use a Document.tsx file as an HTML template. It offers customization options for the filepath and output directory and is built with the solidjs framework. With the ability to automatically detect solidjs if vite-plugin-solid is present, this plugin streamlines the process of creating HTML templates for your Vite projects.