-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.js
More file actions
37 lines (35 loc) · 964 Bytes
/
vite.config.js
File metadata and controls
37 lines (35 loc) · 964 Bytes
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 { defineConfig } from 'vite';
import { execSync } from 'child_process';
export default defineConfig({
base: './',
build: {
outDir: 'src/sphinx_breeze_theme/theme/breeze/static',
emptyOutDir: false,
cssCodeSplit: false,
assetsInlineLimit: 0,
rollupOptions: {
input: 'src/sphinx_breeze_theme/assets/scripts/breeze.ts',
output: {
format: 'iife',
entryFileNames: 'scripts/breeze.js',
assetFileNames: (assetInfo) => {
if (assetInfo.names?.some(name => /\.css$/.test(name))) {
return 'styles/breeze.css';
}
if (assetInfo.names?.some(name => /\.(woff2?|ttf|eot)$/.test(name))) {
return 'fonts/[name].[ext]';
}
return '[name].[ext]';
}
}
}
},
plugins: [
{
name: 'generate-icons',
buildStart() {
execSync('node scripts/generate-icons.js', { stdio: 'inherit' });
}
}
]
});