Files
tasknote/client/vite.config.ts
T
rmcampos 169f07801a
Main CI-Frontend / Build & Push (push) Successful in 39s
Main CI-Backend / Build & Push (push) Successful in 45s
Security/critical fixes (#4)
## What

- Addressing security issues: critical and not so critical (more fixed will be pushed soon)

## Why

- The app needs to be secure and safe.

## Mood
<img width="200" src="https://media2.giphy.com/media/CSpfd57m9WGHnxMWXm/100.webp?cid=36b14facw100seggylsefdj0ap2oopoux3bn3jn6qu59xggq&ep=v1_gifs_search&rid=100.webp&ct=g"/>

Reviewed-on: #4
2026-06-29 19:23:41 +00:00

56 lines
1.1 KiB
TypeScript

import { ConfigEnv, defineConfig, UserConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'url';
import path from 'path';
export default defineConfig(({ mode }: ConfigEnv) => {
const config: UserConfig = {
define: {},
plugins: [
{
name: 'build-html',
apply: 'build',
transformIndexHtml: (html) => {
return {
html,
tags: [
{
tag: 'script',
attrs: {
src: '/env.js'
},
injectTo: 'head'
}
]
};
}
},
react()
],
build: {
outDir: 'dist',
sourcemap: mode === 'development'
},
server: {
port: 5000
},
preview: {
port: 5000
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap')
}
}
};
if (mode === 'development') {
if (config.define) {
config.define.global = {};
}
}
return config;
});