From 8362d7fd7acc4d30906db177d9cf195ba1254b82 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 29 Mar 2022 20:44:18 +0200 Subject: [PATCH] feat(examples): Add path alias for local dev --- examples/tsconfig.json | 5 +++++ examples/vite.config.ts | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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: {