feat: add @scripts resolve alias

This commit is contained in:
xHyroM 2023-06-03 17:03:40 +02:00
parent 49546bed12
commit 134f0ce564
No known key found for this signature in database
GPG key ID: BE0423F386C436AA
5 changed files with 11 additions and 5 deletions

View file

@ -50,6 +50,7 @@ export default defineConfig({
"~": resolve(__dirname, "./src"), "~": resolve(__dirname, "./src"),
"@pages": resolve(__dirname, "./src/pages"), "@pages": resolve(__dirname, "./src/pages"),
"@assets": resolve(__dirname, "./src/assets"), "@assets": resolve(__dirname, "./src/assets"),
"@scripts": resolve(__dirname, "./src/scripts"),
"@layouts": resolve(__dirname, "./src/layouts"), "@layouts": resolve(__dirname, "./src/layouts"),
"@components": resolve(__dirname, "./src/components"), "@components": resolve(__dirname, "./src/components"),
}, },

View file

@ -1,5 +1,5 @@
<div class="snow-container absolute top-0 left-0 z-[-1000] h-full w-full"></div> <div class="snow-container absolute left-0 top-0 z-[-1000] h-full w-full"></div>
<script> <script>
import "../../scripts/snow.js"; import "@scripts/snow.js";
</script> </script>

View file

@ -43,7 +43,7 @@ const { title, description, keywords, schemaOrg } = {
<slot /> <slot />
<script> <script>
import "../scripts/menu.ts"; import "@scripts/menu.ts";
</script> </script>
<style is:global> <style is:global>
::-webkit-scrollbar { ::-webkit-scrollbar {

View file

@ -8,7 +8,11 @@ const item = Astro.props;
const currentPage = new URL(Astro.request.url).pathname; const currentPage = new URL(Astro.request.url).pathname;
--- ---
<Layout title={`Docs - ${item.content.title}`} description={item.content.description} url={`https://xhyrom.dev${item.url}`}> <Layout
title={`Docs - ${item.content.title}`}
description={item.content.description}
url={`https://xhyrom.dev${item.url}`}
>
<Navbar /> <Navbar />
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
@ -38,5 +42,5 @@ const currentPage = new URL(Astro.request.url).pathname;
</Layout> </Layout>
<script> <script>
import "../../scripts/sidebarToggle.js"; import "@scripts/sidebarToggle.js";
</script> </script>

View file

@ -6,6 +6,7 @@
"~/*": ["src/*"], "~/*": ["src/*"],
"@pages/*": ["src/pages/*"], "@pages/*": ["src/pages/*"],
"@assets/*": ["src/assets"], "@assets/*": ["src/assets"],
"@scripts/*": ["src/scripts"],
"@layouts/*": ["src/layouts/*"], "@layouts/*": ["src/layouts/*"],
"@components/*": ["src/components/*"] "@components/*": ["src/components/*"]
} }