-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
vite.config.js
32 lines (30 loc) · 1.12 KB
/
vite.config.js
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
import { defineConfig } from 'vite'
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import babel from "@rollup/plugin-babel";
export default defineConfig({
build: {
emptyOutDir: true,
outDir: "dist",
rollupOptions: {
input: "src/index.js", // Only bundle the entry point
output: {
entryFileNames: "gms2.api.js", // Your desired output name
format: "cjs", // CommonJS format for compatibility
exports: "named", // Ensure named exports are preserved
},
treeshake: false, // Disable tree-shaking to preserve exports
plugins: [
resolve({
browser: true, // Resolve for browser environment
}),
commonjs(), // Allow importing of CommonJS modules
babel({
babelHelpers: "bundled",
presets: ["@babel/preset-env"],
}),
],
},
minify: false, // Disable minification for now to avoid issues
}
});