-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
45 lines (35 loc) · 1.17 KB
/
vite.config.js
File metadata and controls
45 lines (35 loc) · 1.17 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
38
39
40
41
42
43
44
45
import { resolve } from 'path';
import { defineConfig } from 'vite';
export default defineConfig({
build: {
// Specify output directory for bundled files
outDir: 'dist',
// Clean the output directory before building
emptyOutDir: true,
// Configure the library build
lib: {
// Entry point is your main.js file
entry: resolve(__dirname, 'scripts/youtube/main.js'),
// Name of your library (used for IIFE global variable)
name: 'YoutubeCleaner',
// Output filename
fileName: () => 'yt-bundle.js',
},
// Configure Rollup-specific options
rollupOptions: {
output: {
// Use IIFE format for browser compatibility
format: 'iife',
// Ensure all imports are bundled into a single file
inlineDynamicImports: true,
// Prevent code splitting
manualChunks: undefined,
// Ensure proper global variable name
extend: true
}
},
// Development settings
minify: process.env.NODE_ENV === 'production', // Only minify in production
sourcemap: true, // Enable source maps for debugging
}
});