mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-15 19:46:56 +03:00
* chore(deps-dev): bump vite from 7.3.2 to 8.0.10 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.2 to 8.0.10. - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.0.10/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 8.0.10 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix(build): use assetInfo.names array for vite 8 / rolldown Vite 8 switched to Rolldown, where some asset hooks (e.g. the css-post plugin's resolveAssetUrlsInCss) pass an assetInfo whose deprecated `name` property is undefined, breaking `name.endsWith()` in our assetFileNames callback. Read from `assetInfo.names[0]` (Rollup 4 / Rolldown API) and fall back to `name` for any caller still on the old shape. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LearningCircuit <185559241+LearningCircuit@users.noreply.github.com>
80 lines
2.0 KiB
JavaScript
80 lines
2.0 KiB
JavaScript
/// <reference types="vitest/config" />
|
|
import { defineConfig } from 'vite';
|
|
import { resolve } from 'path';
|
|
|
|
export default defineConfig({
|
|
root: 'src/local_deep_research/web/static',
|
|
base: '/static/',
|
|
|
|
// Ensure Vite handles Font Awesome fonts correctly
|
|
assetsInclude: ['**/*.woff', '**/*.woff2', '**/*.ttf', '**/*.eot'],
|
|
|
|
build: {
|
|
// Output directory relative to root
|
|
outDir: 'dist',
|
|
|
|
// Generate manifest for Flask integration
|
|
manifest: true,
|
|
|
|
// Single entry point that includes all dependencies
|
|
rollupOptions: {
|
|
input: {
|
|
app: resolve(__dirname, 'src/local_deep_research/web/static/js/app.js'),
|
|
},
|
|
output: {
|
|
// Consistent file naming
|
|
entryFileNames: 'js/[name].[hash].js',
|
|
chunkFileNames: 'js/[name].[hash].js',
|
|
assetFileNames: (assetInfo) => {
|
|
const name = assetInfo.names?.[0] ?? assetInfo.name ?? '';
|
|
if (name.endsWith('.css')) {
|
|
return 'css/[name].[hash][extname]';
|
|
}
|
|
if (/\.(?:woff2?|ttf|eot|svg)$/.test(name)) {
|
|
return 'fonts/[name].[hash][extname]';
|
|
}
|
|
return 'assets/[name].[hash][extname]';
|
|
}
|
|
}
|
|
},
|
|
|
|
// Optimize chunks
|
|
chunkSizeWarningLimit: 1000,
|
|
},
|
|
|
|
server: {
|
|
// Development server settings
|
|
port: 5173,
|
|
strictPort: true,
|
|
|
|
// Proxy API requests to Flask
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:5000',
|
|
changeOrigin: true,
|
|
},
|
|
'/socket.io': {
|
|
target: 'http://localhost:5000',
|
|
ws: true,
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
},
|
|
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src/local_deep_research/web/static'),
|
|
'@js': resolve(__dirname, 'src/local_deep_research/web/static/js'),
|
|
'@css': resolve(__dirname, 'src/local_deep_research/web/static/css'),
|
|
}
|
|
},
|
|
|
|
test: {
|
|
environment: 'happy-dom',
|
|
globals: true,
|
|
root: resolve(__dirname),
|
|
include: ['tests/js/**/*.test.js'],
|
|
setupFiles: ['tests/js/setup.js'],
|
|
}
|
|
});
|