vite-plugin-define-html
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

vite-plugin-define-html

Let's you define variables which can be used in your HTML files!

import type { UserConfig } from "vite";
import html from "vite-plugin-define-html";

export default {
	plugins: [
		html({
			APP_TITLE: "App Title",
			ANALYTICS_KEY: "analytics_key",
		}),
	],
} as UserConfig;
<!DOCTYPE html>
<html>
	<head>
		<title><% APP_TITLE /></title>
	</head>
	<body>
		<script
			type="application/javascript"
			src="analytics.js?k=<% ANALYTICS_KEY />"
		></script>
	</body>
</html>

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-define-html

Weekly Downloads

23

Version

1.0.2

License

MIT

Unpacked Size

3.4 kB

Total Files

5

Last publish

Collaborators

  • mckayla-archive