Files
personotes/frontend/vite.config.js
2025-11-12 17:16:13 +01:00

29 lines
886 B
JavaScript

// frontend/vite.config.js
import { defineConfig } from 'vite';
import path from 'path'; // Import path module
export default defineConfig({
resolve: {
alias: {
// Force all @codemirror/state imports to resolve to a single instance
'@codemirror/state': path.resolve(__dirname, 'node_modules/@codemirror/state'),
'@codemirror/view': path.resolve(__dirname, 'node_modules/@codemirror/view'),
},
},
build: {
lib: {
entry: 'src/main.js', // This will be our main entry point
name: 'PersoNotesFrontend',
fileName: (format) => `personotes-frontend.${format}.js`
},
outDir: '../static/dist', // Output to a new 'dist' folder inside the existing 'static' directory
emptyOutDir: true,
rollupOptions: {
output: {
// Ensure that the output is a single file
manualChunks: undefined,
}
}
}
});