// vite.config.tsimport{defineConfig}from'vite'importHTMLInjectCommandsfrom'vite-plugin-html-inject-commands'exportdefaultdefineConfig({plugins:[HTMLInjectCommands({commands:[/*** Example: inject git commit hash and date to meta tag under head* Result into head: `<meta name="git:commit" content...
Split your index.html into smaller, reusable static HTML pieces. // vite.config.js import { defineConfig } from 'vite'; import injectHTML from 'vite-plugin-html-inject'; export default defineConfig({ plugins: [injectHTML()], }); Load those sweet separate HTML files <!-- index.html -...
If you need server proxy, such as change urlhttp://localhost:xxxx/index.htmltohttp://localhost:xxxx/overview, you should set config like this: viteHtmlPlugin({template:'index.html',templateParameters:{BASIC_PATH:path.join(__dirname,'./public/template.html'),INJECT_SCRIPT:`<script type="mod...
@tomjs/vite-plugin-monaco-editor English|中文 viteplugin formonaco-editor, inject scripts for index.html Features Use libraries in thenode_modulesdirectory whenvite serve Optional use oflocalorCDNwhenvite build Install #pnpmpnpm add monaco-editor pnpm add @tomjs/vite-plugin-monaco-editor -D#yarn...
Describe the bug In mpa mode, the legacy scripts are injected into html pages which have no javascript in it. Reproduction https://stackblitz.com/edit/vitejs-vite-uysirc Steps to reproduce Run: npm install npm run build Observe the dist/...
Next generation frontend tooling. It's fast! Contribute to vitejs/vite development by creating an account on GitHub.