1.0.0 • Published 4 months ago

vite-plugin-ts5-nameof v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

:warning: Warning :warning:

Don't use ts-nameof anymore

Try to use ts-keyof instead.

This plugin will not work anymore with TypeScript v5+.
You will see errors like ts.createliteral is not a function.

Usage

  1. Install as devDependencies

    npm add --save-dev vite-plugin-ts-nameof
    # or
    yarn add --dev vite-plugin-ts-nameof
    # or
    pnpm add --save-dev vite-plugin-ts-nameof
  2. Inject vite-plugin-ts-nameof using the vite.config.ts module

    import vue from '@vitejs/plugin-vue';
    import { defineConfig } from 'vite';
    import tsNameof from 'vite-plugin-ts-nameof';
    
    // https://vitejs.dev/config/
    export default defineConfig({
      plugins: [tsNameof(), vue()],
    });
  3. Add ts-nameof.d.ts to your tsconfig.json

    {
      // "compilerOptions"
      // "include"
      // ...
      "files": ["./node_modules/ts-nameof/ts-nameof.d.ts"]
    }

More Awesome Vite Plugins

Can be found here: Awesome Vite.js