mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
npm update and set rollupOptions in vite config
The goal is to prevent errors with source maps
This commit is contained in:
parent
123c49662f
commit
e04d09b8c5
2 changed files with 2150 additions and 3098 deletions
5224
client/package-lock.json
generated
5224
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -3,25 +3,39 @@ import react from '@vitejs/plugin-react-swc';
|
|||
import pluginChecker from 'vite-plugin-checker';
|
||||
import EnvironmentPlugin from 'vite-plugin-environment';
|
||||
|
||||
// Filter out environment variables with invalid identifiers
|
||||
const filteredEnv = Object.keys(process.env).reduce((acc, key) => {
|
||||
// Only include environment variables with valid JavaScript identifiers
|
||||
if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
|
||||
acc[key] = process.env[key];
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: "/",
|
||||
plugins: [
|
||||
react(),
|
||||
pluginChecker({ typescript: true }),
|
||||
EnvironmentPlugin('all'),
|
||||
EnvironmentPlugin(filteredEnv),
|
||||
],
|
||||
preview: {
|
||||
port: 5173,
|
||||
strictPort: true
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
host: true,
|
||||
origin: "http://0.0.0.0:5173",
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
host: true,
|
||||
origin: "http://0.0.0.0:5173",
|
||||
},
|
||||
build: {
|
||||
sourcemap: true, // Enable source maps
|
||||
rollupOptions: {
|
||||
output: {
|
||||
sourcemapExcludeSources: true, // Exclude sources from source maps
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue