Skip to content

Commit f28ae1e

Browse files
committed
Update Astro config
- Update types - Add trailingSlash option
1 parent ccbd03c commit f28ae1e

3 files changed

Lines changed: 11 additions & 79 deletions

File tree

astro.config.ts

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { RehypePlugin } from "@astrojs/markdown-remark";
2-
import type { AstroIntegration, AstroUserConfig } from "astro";
2+
import type { AstroIntegration } from "astro";
33
import type { Options as AutolinkHeadingsOptions } from "rehype-autolink-headings";
44
import type { Options as ClassNamesOptions } from "rehype-class-names";
55
import type { Options as ExternalLinksOptions } from "rehype-external-links";
6-
import type { FileImporter, Importer, StringOptions } from "sass-embedded";
6+
import type { FileImporter, Importer } from "sass-embedded";
77
import type { ShikiTransformer } from "shiki";
8-
import type { PluginOption } from "vite";
8+
import type { PluginOption, SassPreprocessorOptions } from "vite";
99

1010
import cp from "node:child_process";
1111
import fs from "node:fs/promises";
@@ -15,6 +15,7 @@ import util from "node:util";
1515

1616
import { rehypeHeadingIds } from "@astrojs/markdown-remark";
1717
import mdx from "@astrojs/mdx";
18+
import { defineConfig } from "astro/config";
1819
// @ts-expect-error - There's no type declaration but it exists.
1920
import remarkA11yEmoji from "@fec/remark-a11y-emoji";
2021
import { addExtension, createFilter, dataToEsm } from "@rollup/pluginutils";
@@ -370,21 +371,7 @@ const importScssJson: Importer<"async"> = {
370371
},
371372
};
372373

373-
/**
374-
* @see
375-
* {@link https://vite.dev/config/shared-options.html#css-preprocessoroptions}
376-
*/
377-
type ViteSassOptions = StringOptions<"async"> & {
378-
/**
379-
* Sets which Sass API to use.
380-
*/
381-
api?: "legacy" | "modern" | "modern-compiler";
382-
/**
383-
* Injects code at the top of each stylesheet.
384-
*/
385-
additionalData?: string;
386-
};
387-
const scss: ViteSassOptions = {
374+
const scss: SassPreprocessorOptions = {
388375
api: "modern-compiler",
389376
additionalData: partialsImport,
390377
importers: [importScssPartials, importScssJson],
@@ -439,8 +426,9 @@ const generateIdsPlugin: PluginOption = {
439426
},
440427
};
441428

442-
export default <AstroUserConfig>{
429+
export default defineConfig({
443430
site: "https://mce.codes",
431+
trailingSlash: "never",
444432
devToolbar: { enabled: false },
445433
compressHTML: false,
446434
scopedStyleStrategy: "class",
@@ -468,4 +456,4 @@ export default <AstroUserConfig>{
468456
css: { preprocessorOptions: { scss } },
469457
plugins: [generateIdsPlugin],
470458
},
471-
};
459+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"sharp": "^0.34.3",
3232
"shiki": "^3.15.0",
3333
"ultrahtml": "^1.6.0",
34-
"vite": "^7.2.4"
34+
"vite": "^6.4.1"
3535
}
3636
}

pnpm-lock.yaml

Lines changed: 2 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)