Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

aslilac/vite-plugin-define-html

Repository files navigation

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>

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published