Plugin for Vite that replaces include tags with corresponding HTML components
npm install @kingkongdevs/vite-plugin-html-includes tags with the contents of the referenced HTML file.locals attribute., , , , , , and constructs.
`Output:
`
`$3
HTML:
`
`Output:
`
Welcome to the Home Page
Welcome to the About Page
Welcome to the Site
`$3
HTML:
`
`Output:
`
Foo really is bar! Revolutionary!
Foo is wow, oh man.
Foo is probably just foo in the end.
`$3
HTML:
`
`Output:
`
{{ index }}: {{ item }}
`
Usage
Import viteHTMLIncludes from @kingkongdevs/vite-plugin-html-includes`
import viteHTMLIncludes from '@kingkongdevs/vite-plugin-html-includes';
`
Add the viteHTMLIncludes to your
vite.config.js file's plugins array:
`
plugins: [
viteHTMLIncludes({
componentsDir: '/components/',
}),
]
`Plugin Options
$3
- #### Type: string
- #### Default: '/components/'`