TroubleshootingTypeScript

TypeScript

Monicon uses TypeScript to generate types for the icons. To enable TypeScript type definitions for your icons, add the following configuration to your tsconfig.json file:

tsconfig.json
{
  "include": [".monicon/*.d.ts"]
}

You can also use the typesFileName option to specify the name of the file to output the types to. If you want to disable the types file, you can set the generateTypes option to false.

apps/vite-react/vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import monicon from "@monicon/vite";
 
export default defineConfig({
  plugins: [
    react(),
    monicon({
      typesFileName: "types",
      generateTypes: true,
    }),
  ],
});