Fixati forse veramente i problemi del .env

main
Antonio De Lucreziis 4 years ago
parent 7fd95eafd5
commit 9de7e460ff

File diff suppressed because it is too large Load Diff

@ -12,6 +12,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"dotenv": "^16.0.0",
"sass": "^1.49.9", "sass": "^1.49.9",
"vite": "^2.8.6" "vite": "^2.8.6"
} }

@ -1,22 +1,29 @@
import { defineConfig, loadEnv } from 'vite'
import { resolve } from 'path' import { resolve } from 'path'
import { defineConfig } from 'vite'
export default defineConfig({ export default defineConfig(({ mode }) => {
build: { process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') }
rollupOptions: {
input: { console.log(`BASE_URL = "${process.env.BASE_URL}"`)
main: resolve(__dirname, 'index.html'),
login: resolve(__dirname, 'login.html'), return {
base: process.env.BASE_URL,
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
login: resolve(__dirname, 'login.html'),
},
}, },
}, },
}, server: {
server: { proxy: {
proxy: { '/api': {
'/api': { target: 'http://localhost:4000/api',
target: 'http://localhost:4000/api', changeOrigin: true,
changeOrigin: true, rewrite: path => path.replace(/^\/api/, ''),
rewrite: path => path.replace(/^\/api/, ''), },
}, },
}, },
}, }
}) })

Loading…
Cancel
Save