All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 38s
Reviewed-on: #21 Co-authored-by: GauthierWebDev <gauthier@gauthierdaniels.fr> Co-committed-by: GauthierWebDev <gauthier@gauthierdaniels.fr>
53 lines
1.3 KiB
TypeScript
Executable File
53 lines
1.3 KiB
TypeScript
Executable File
import type { Root } from "postcss";
|
|
|
|
import remarkExtractFrontmatter from "./remarkExtractFrontmatter";
|
|
import prismjsVitePlugin from "vite-plugin-prismjs";
|
|
import remarkFrontmatter from "remark-frontmatter";
|
|
import remarkHeadingId from "./remarkHeadingId";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { telefunc } from "telefunc/vite";
|
|
import vikeSolid from "vike-solid/vite";
|
|
import { defineConfig } from "vite";
|
|
import mdx from "@mdx-js/rollup";
|
|
import vike from "vike/plugin";
|
|
import path from "node:path";
|
|
|
|
type RemoveCommentRules = (root: Root) => void;
|
|
|
|
const removeCommentRules: RemoveCommentRules = (root) => {
|
|
root.walkComments((comment) => {
|
|
comment.remove();
|
|
});
|
|
};
|
|
|
|
const __dirname = path.resolve();
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
prismjsVitePlugin({
|
|
languages: ["javascript", "typescript", "tsx", "jsx", "css", "html", "bash", "nginx", "sql"],
|
|
}),
|
|
vike(),
|
|
vikeSolid(),
|
|
mdx({
|
|
jsxImportSource: "solid-jsx",
|
|
remarkPlugins: [remarkFrontmatter, remarkHeadingId, remarkExtractFrontmatter],
|
|
}),
|
|
tailwindcss(),
|
|
telefunc(),
|
|
],
|
|
css: {
|
|
postcss: {
|
|
plugins: [...(process.env.NODE_ENV === "production" ? [removeCommentRules] : [])],
|
|
},
|
|
},
|
|
build: {
|
|
target: "es2022",
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": __dirname,
|
|
},
|
|
},
|
|
});
|