-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): implement type generation
- Loading branch information
1 parent
b00ffff
commit eedb955
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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: | ||
|
||
```json filename="tsconfig.json" copy {2} | ||
{ | ||
"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`. | ||
|
||
```ts filename="apps/vite-react/vite.config.ts" copy {8} | ||
import { defineConfig } from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
import monicon from "@monicon/vite"; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
react(), | ||
monicon({ typesFileName: "types.d.ts", generateTypes: true }), | ||
], | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters