-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathvite.config.js
More file actions
47 lines (46 loc) · 1.15 KB
/
vite.config.js
File metadata and controls
47 lines (46 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
38
39
40
41
42
43
44
45
46
47
import { defineConfig } from 'vite';
import path from 'path';
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.js'),
name: 'CSLEditor',
formats: ['es', 'umd'],
fileName: (format) => `csl-editor.${format}.js`
},
rollupOptions: {
// Externalize dependencies that shouldn't be bundled
external: ['jquery'],
output: {
globals: {
jquery: 'jQuery'
},
// Preserve the directory structure for assets
assetFileNames: (assetInfo) => {
if (assetInfo.name.endsWith('.css')) {
return 'css/[name][extname]';
}
return 'assets/[name][extname]';
}
}
},
outDir: 'dist',
sourcemap: true,
// Increase chunk size warning limit for citeproc.js
chunkSizeWarningLimit: 2000
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'external': path.resolve(__dirname, 'external')
}
},
server: {
port: 3000,
open: true
},
// Don't try to optimize citeproc.js - it's legacy code
optimizeDeps: {
exclude: ['external/citeproc/citeproc.js']
}
});