Skip to content

Commit e2ac607

Browse files
committed
Add the @ alias in Vite config
1 parent 49ca282 commit e2ac607

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import { ref, onMounted, computed, watch } from "vue"
33
4-
import AssistanceModal from "./components/AssistanceModal.vue"
5-
import TroubleshooterStep from "./components/TroubleshooterStep.vue"
4+
import AssistanceModal from "@/components/AssistanceModal.vue"
5+
import TroubleshooterStep from "@/components/TroubleshooterStep.vue"
66
import { getSteps, generateReport } from "./troubleshooter"
77
88
const sleep = (m: number) => new Promise((r) => setTimeout(r, m))

src/components/TroubleshooterStep.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { inject, onMounted, useTemplateRef } from "vue"
33
4-
import TroubleshooterStepOption from "./TroubleshooterStepOption.vue"
4+
import TroubleshooterStepOption from "@/components/TroubleshooterStepOption.vue"
55
import type { Step } from "@/troubleshooter"
66
77
const debug = inject<boolean>("debug")

vite.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { resolve } from "node:path"
2+
import { fileURLToPath, URL } from "node:url"
23

3-
import { defineConfig, Plugin } from "vite"
4+
import { defineConfig } from "vite"
45
import Vue from "@vitejs/plugin-vue"
56
import mdiAttrs from "markdown-it-attrs"
67
import mdiHljs from "markdown-it-highlightjs"
@@ -27,6 +28,11 @@ export default defineConfig(({ mode }) => ({
2728
define: {
2829
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
2930
},
31+
resolve: {
32+
alias: {
33+
"@": fileURLToPath(new URL("./src", import.meta.url)),
34+
},
35+
},
3036
plugins: [
3137
Vue({
3238
include: [/\.vue$/, /\.md$/],

0 commit comments

Comments
 (0)