feat: Add @ alias to ./src

This commit is contained in:
frostime 2023-06-06 15:44:42 +08:00
parent 14479d3d14
commit 6b903d5a14
4 changed files with 17 additions and 6 deletions

View file

@ -1,8 +1,8 @@
<script lang="ts">
import { onDestroy, onMount } from "svelte";
import { version } from "./api";
import { version } from "@/api";
import { showMessage } from "siyuan";
import Typo from "./libs/b3-typography.svelte";
import Typo from "@/libs/b3-typography.svelte";
export let name: string;
export let i18n: any;

View file

@ -10,10 +10,10 @@ import {
getBackend,
IModel
} from "siyuan";
import "./index.scss";
import "@/index.scss";
import HelloExample from "./hello.svelte";
import SettingPannel from "./libs/setting-panel.svelte";
import HelloExample from "@/hello.svelte";
import SettingPannel from "@/libs/setting-panel.svelte";
const STORAGE_NAME = "menu-config";
const TAB_TYPE = "custom_tab";

View file

@ -35,7 +35,12 @@
"node",
"vite/client",
"svelte"
]
],
"baseUrl": "./src",
"paths": {
"@/*": ["*"],
"@/libs/*": ["libs/*"],
}
},
"include": [
"tools/**/*.ts",

View file

@ -16,6 +16,12 @@ console.log("isWatch=>", isWatch)
console.log("distDir=>", distDir)
export default defineConfig({
resolve: {
alias: {
"@": resolve(__dirname, "src"),
}
},
plugins: [
svelte(),