-
Install as
devDependencies
npm add --save-dev vite-plugin-ts5-nameof # or yarn add --dev vite-plugin-ts5-nameof # or pnpm add --save-dev vite-plugin-ts5-nameof
-
Inject
vite-plugin-ts5-nameof
using thevite.config.ts
moduleimport vue from '@vitejs/plugin-vue'; import { defineConfig } from 'vite'; import tsNameof from 'vite-plugin-ts5-nameof'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [tsNameof(), vue()], });
-
Add
ts5-nameof.d.ts
to yourtsconfig.json
{ // "compilerOptions" // "include" // ... "files": ["./node_modules/ts5-nameof/ts5-nameof.d.ts"] }
Can be found here: Awesome Vite.js