-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (36 loc) · 1.15 KB
/
vite.config.ts
File metadata and controls
37 lines (36 loc) · 1.15 KB
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 path from "path"
import tailwindcss from "@tailwindcss/vite"
import react from "@vitejs/plugin-react-swc"
import mdx from "@mdx-js/rollup";
import {defineConfig} from "vite"
// https://vite.dev/config/
export default defineConfig({
plugins: [mdx(), react(), tailwindcss()],
css: {
postcss: "./postcss.config.cjs",
},
define: {
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "development")
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
minify: false, // Disable minification (obfuscation)
sourcemap: true, // Generate source maps
lib: {
entry: "src/index.tsx", // Library's entry point
name: "editsaurus", // Global variable for the UMD bundle
formats: ["iife"], // ESM only
fileName: () => `editsaurus.js` // Single file output
},
rollupOptions: {}
},
server: {
open: false, // Prevent auto-opening the browser
cors: true, // Enable CORS for cross-origin requests
host: "0.0.0.0" // Allow access from other devices
}
})