30 lines
660 B
TypeScript
30 lines
660 B
TypeScript
import { defineConfig, loadEnv } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
// Load env file based on mode
|
|
const env = loadEnv(mode, process.cwd(), '');
|
|
|
|
return {
|
|
plugins: [
|
|
react(),
|
|
createHtmlPlugin({
|
|
inject: {
|
|
data: {
|
|
VITE_APP_NAME: env.VITE_APP_NAME || 'PowerOn',
|
|
},
|
|
},
|
|
}),
|
|
],
|
|
envPrefix: 'VITE_',
|
|
server: {
|
|
https: false,
|
|
},
|
|
css: {
|
|
modules: {
|
|
scopeBehaviour: 'local', // Default behavior for CSS modules
|
|
},
|
|
},
|
|
};
|
|
});
|