pswui/packages/react/vite.config.ts
p-sw edfaef2c75 feat: add lib alias in vite config and tsconfig
The commit includes a new alias @pswui-lib in both the `vite.config.ts` and `tsconfig.json` files. This change facilitates a more straightforward and concise import of files located in the 'lib' directory.
2024-06-11 15:43:56 +09:00

35 lines
917 B
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "tailwindcss";
import mdx from "@mdx-js/rollup";
import { resolve } from "node:path";
import remarkGfm from "remark-gfm";
import withSlug from "rehype-slug";
import withToc from "@stefanprobst/rehype-extract-toc";
import withTocExport from "@stefanprobst/rehype-extract-toc/mdx";
import dynamicImport from "vite-plugin-dynamic-import";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
mdx({
rehypePlugins: [withSlug, withToc, withTocExport],
remarkPlugins: [remarkGfm],
}),
dynamicImport(),
],
css: {
postcss: {
plugins: [tailwindcss()],
},
},
resolve: {
alias: {
"@components": resolve(__dirname, "./components"),
"@": resolve(__dirname, "./src"),
"@pswui-lib": resolve(__dirname, "./lib"),
},
},
});