diff --git a/examples/tsconfig.json b/examples/tsconfig.json index a80a9f64..b975d89e 100644 --- a/examples/tsconfig.json +++ b/examples/tsconfig.json @@ -21,6 +21,11 @@ "types": [ "vite/client" ], + "paths": { + "~/*": [ + "../package/src/*" + ] + } }, "exclude": [ "node_modules", diff --git a/examples/vite.config.ts b/examples/vite.config.ts index e6b66998..33cd19c2 100644 --- a/examples/vite.config.ts +++ b/examples/vite.config.ts @@ -1,16 +1,22 @@ +import { resolve } from 'path' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueTypes from 'vite-plugin-vue-type-imports' import AutoImport from 'unplugin-auto-import/vite' export default defineConfig({ + resolve: { + alias: { + '~': resolve('../package/src'), + }, + }, plugins: [ vue(), vueTypes(), // https://github.com/antfu/unplugin-auto-import AutoImport({ imports: ['vue', '@vueuse/core'], - dts: 'src/auto-imports.d.ts', + dts: resolve('src/auto-imports.d.ts'), }), ], optimizeDeps: {