@web2paper/vite-plugin-include
v0.0.2
Published
Vite plugin to add support for an include tag in HTML.
Downloads
5
Readme
This is a Vite plugin for Web2Paper. It allows the inclusion of template files at build time when using static template engines (i.e. not JS).
This package is part of the @web2paper/modeling-* ecosystem.
⚠️ Web2Paper and its ecosystem are under construction. Expect breaking change to API and bugs.
Usage
// vite.config.ts
import {defineConfig} from 'vite'
import {viteWeb2PaperInclude} from "@web2paper/vite-plugin-include";
export default defineConfig({
// [...]
plugins: [
// [...]
viteWeb2PaperInclude(),
// [...]
],
})<!-- Include a file in the template-->
<include src="src/template/header.html"></include>Why is it necessary ?
Web2Paper supports multiple template engines but requires the template of a model to be provided as a single file. This vite plugins allows source code to have multiple files while building a single file.
