1.0.0 • Published 1 year ago

vite-plugin-vtpl v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

vite-plugin-vtpl

A vite plugin to transform your html using template syntax

Installation

npm i vite-plugin-vtpl

Usage

In your vite config

import { defineConfig, loadEnv } from 'vite'
import vtpl from 'vite-plugin-vtpl'

// https://vitejs.dev/config/
export default async ( { mode } ) => {
  const env = loadEnv( mode, process.cwd() )

  return defineConfig({
    plugins: [
      // ... your other plugins
      vtpl(
        // data
        {
          hello: 'world'
        },
        // options
        {
          openTag: '{{',
          closeTag: '}}',
          escape: true
        }
      )
    ],
  })
}

license

MIT

1.0.0

1 year ago