-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvite.config.ts
37 lines (36 loc) · 1.06 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import solid from 'solid-start/vite';
import { defineConfig } from 'vite';
import Markdown from 'vite-plugin-solid-markdown';
import remarkGfm from 'remark-gfm';
import remarkDirective from 'remark-directive';
import remarkDirectiveRehype from 'remark-directive-rehype';
import rehypeHighlight from 'rehype-highlight';
export default defineConfig({
plugins: [
Markdown({
remarkPlugins: [remarkGfm, remarkDirective, remarkDirectiveRehype],
rehypePlugins: [rehypeHighlight],
}),
solid({ ssr: false, extensions: ['.mdx', '.md'] }),
{
name: 'add-cors',
configureServer(server) {
server.middlewares.use((_req, res, next) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.setHeader('Cross-Origin-Embedder-Policy', 'credentialless');
next();
});
},
},
],
ssr: {
external: ['monaco-editor'],
},
server: {
open: process.env.NODE_ENV === 'development',
},
optimizeDeps: {
entries: ['./src/**/*.{js,jsx,ts,tsx,mdx,md}'],
exclude: ['solid-mdx'],
},
});