pashto-grammar/vite.config.ts

106 lines
2.8 KiB
TypeScript
Raw Normal View History

2024-05-13 11:23:11 +00:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
2023-02-04 12:20:48 +00:00
import mdx from "@mdx-js/rollup";
2024-05-13 11:23:11 +00:00
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import rehypeSlug from "rehype-slug";
2023-02-04 12:20:48 +00:00
import rehypeToc from "@stefanprobst/rehype-extract-toc";
import rehypeTocExport from "@stefanprobst/rehype-extract-toc/mdx";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import { VitePWA } from "vite-plugin-pwa";
import remarkGfm from "remark-gfm";
// https://vitejs.dev/config/
export default defineConfig({
define: {
"process.env": process.env,
},
plugins: [
react(),
// @ts-ignore
mdx({
remarkPlugins: [
remarkFrontmatter,
[remarkMdxFrontmatter, { name: "frontMatter" }],
remarkGfm,
],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
properties: { className: "heading-link" },
},
],
rehypeToc,
rehypeTocExport,
],
}),
VitePWA({
workbox: {
2024-05-13 11:23:11 +00:00
globPatterns: [
"**/*.(js|html|svg|png|jpg|jpeg|eot|woff|woff2|ttf|mp4|m4a)",
],
2023-02-04 12:20:48 +00:00
maximumFileSizeToCacheInBytes: 5242880,
},
2024-05-13 11:23:11 +00:00
includeAssets: ["**/*.(js|html|svg|png|jpg|jpeg|eot|woff|woff2|ttf)"],
2023-02-04 12:20:48 +00:00
manifest: {
2024-05-13 11:23:11 +00:00
short_name: "Pashto Grammar",
name: "LingDocs Pashto Grammar",
icons: [
2023-02-04 12:20:48 +00:00
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-36x36.png",
sizes: "36x36",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-48x48.png",
sizes: "48x48",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-72x72.png",
sizes: "72x72",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-96x96.png",
sizes: "96x96",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-144x144.png",
sizes: "144x144",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-192x192.png",
sizes: "192x192",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-256x256.png",
sizes: "256x256",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-384x384.png",
sizes: "384x384",
type: "image/png",
2023-02-04 12:20:48 +00:00
},
{
2024-05-13 11:23:11 +00:00
src: "icons/android-chrome-512x512.png",
sizes: "512x512",
type: "image/png",
},
2023-02-04 12:20:48 +00:00
],
2024-05-13 11:23:11 +00:00
start_url: "./table-of-contents",
display: "minimal-ui",
theme_color: "#DEE1E6",
background_color: "#ffffff",
2023-02-04 12:20:48 +00:00
},
}),
],
});