// vite.config.tsimport { defineConfig } from 'vite'// a package or module that exports macro providerimport { provideEcho } from 'some-macro-provider'import { createMacroPlugin } from 'vite-plugin-macro'import { join } from 'path'const macroPlugin = createMacroPlugin({ // the generated `.d.ts` file will include the types of macros typesPath: join(__dirname, './macros.d.ts'),}).use(provideEcho()) // use a macro providerexport default defineConfig({ plugins: [macroPlugin],})
This package also re-exports @typed-macro/core
so you can define macros directly in your projects.