add path aliasing

This commit is contained in:
joshuaboud 2022-08-23 18:19:20 -03:00
parent 5eb523bdf2
commit 4dfc7ce732
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E
2 changed files with 13 additions and 2 deletions

View File

@ -17,7 +17,12 @@
"skipLibCheck": true, "skipLibCheck": true,
"types": [ "types": [
"vitest/globals", "vitest/globals",
] ],
"allowJs": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}, },
"include": [ "include": [
"src/**/*.ts", "src/**/*.ts",

View File

@ -1,15 +1,21 @@
/// <reference types="vitest/config" /> /// <reference types="vitest/config" />
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue()], plugins: [vue()],
base: "./", base: "./",
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
},
},
build: { build: {
target: [ target: [
"chrome87", "edge88", "firefox78", "safari14" "chrome87", "edge88", "firefox78", "safari14"
] ],
}, },
test: { test: {
globals: true, globals: true,