diff --git a/vite.config.js b/vite.config.js index 84dca6db..768ba895 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,24 +1,31 @@ import { fileURLToPath, URL } from 'node:url'; -import { defineConfig } from 'vite'; +import { defineConfig, loadEnv } from 'vite'; import vue from '@vitejs/plugin-vue'; import vueJsx from '@vitejs/plugin-vue-jsx'; // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [vue(), vueJsx()], - css: { - preprocessorOptions: { - scss: { - additionalData: ` +export default ({ mode }) => { + const env = loadEnv(mode, process.cwd(), ''); + + return defineConfig({ + define: { + 'process.env': env, + }, + plugins: [vue(), vueJsx()], + css: { + preprocessorOptions: { + scss: { + additionalData: ` @import '@weni/unnnic-system/src/assets/scss/unnnic.scss'; `, + }, }, }, - }, - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, }, - }, -}); + }); +};