From 27e271ad8dcfcd45b9edf1d682750ebbf851f1b1 Mon Sep 17 00:00:00 2001 From: aldemylla Date: Tue, 2 Apr 2024 17:02:49 -0300 Subject: [PATCH] fix: Changed config env at vite.config.js --- vite.config.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) 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)), + }, }, - }, -}); + }); +};