-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
50 lines (50 loc) · 1.15 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
38
39
40
41
42
43
44
45
46
47
48
49
50
/// <reference types="vite/client" />
import react from "@vitejs/plugin-react-swc";
import { resolve } from 'node:path';
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import { libInjectCss } from 'vite-plugin-lib-inject-css';
import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
export default defineConfig({
plugins: [
react(),
libInjectCss(),
dts({
insertTypesEntry: true,
copyDtsFiles: true,
tsconfigPath: './tsconfig.json',
outDir: 'dist/types',
})
],
css: {
postcss: {
plugins: [tailwindcss, autoprefixer],
},
},
resolve: {
alias: {
"@": resolve(__dirname, "./lib"),
},
},
build: {
outDir: 'dist',
copyPublicDir: false,
lib: {
entry: resolve(__dirname, "./lib/index.ts"),
name: "nexo-mdx",
fileName: (format) => `index.${format}.js`,
formats: ['es'],
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
minify: 'terser', // Use Terser for minification
}
});