0.1.2 • Published 2 years ago

vite-plugin-env-html v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

vite-plugin-env-html

A vite plugin for env variables in html file

install

npm i vite-plugin-env-html -D

usage

vite.config.js

import { defineConfig, loadEnv } from 'vite'
import htmlPlugin from 'vite-plugin-env-html'

export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd(), '')

  return {
    plugins: [htmlPlugin(env)]
  }
})

.env

VITE_APP_NAME=awesome

index.html

<title>%VITE_APP_NAME%</title>
0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.1

2 years ago