Skip to content

Commit 34c2809

Browse files
committed
Few tweaks to astro config.
1 parent bfab659 commit 34c2809

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

astro.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
import path, { dirname } from 'path';
3+
import { fileURLToPath } from 'url';
14
import { defineConfig } from "astro/config";
25
import mdx from "@astrojs/mdx";
36
import { h } from "hastscript";
@@ -10,8 +13,21 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
1013
import metaTags from "astro-meta-tags";
1114
import pagefind from "astro-pagefind";
1215

16+
const __filename = fileURLToPath(import.meta.url);
17+
const __dirname = dirname(__filename); // @type-check enabled!
18+
1319
// https://astro.build/config
1420
export default defineConfig({
21+
vite: {
22+
define: {
23+
'process.env.VITE_BUILD_TIME': JSON.stringify(new Date().toISOString()),
24+
},
25+
resolve: {
26+
alias: {
27+
'$': path.resolve(__dirname, './src')
28+
}
29+
},
30+
},
1531
markdown: {
1632
remarkPlugins: [
1733
[
@@ -46,4 +62,7 @@ export default defineConfig({
4662
pagefind(),
4763
],
4864
output: "static",
65+
build: {
66+
minify: true
67+
},
4968
});

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"compilerOptions": {
44
"strictNullChecks": true,
55
"jsx": "react-jsx",
6-
"jsxImportSource": "react"
6+
"jsxImportSource": "react",
7+
"paths": {
8+
"$*": ["src/*"]
9+
}
710
}
811
}

0 commit comments

Comments
 (0)