Fixati forse veramente i problemi del .env
This commit is contained in:
Generated
+1136
-1120
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"dotenv": "^16.0.0",
|
||||
"sass": "^1.49.9",
|
||||
"vite": "^2.8.6"
|
||||
}
|
||||
|
||||
+22
-15
@@ -1,22 +1,29 @@
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import { resolve } from 'path'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve(__dirname, 'index.html'),
|
||||
login: resolve(__dirname, 'login.html'),
|
||||
export default defineConfig(({ mode }) => {
|
||||
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') }
|
||||
|
||||
console.log(`BASE_URL = "${process.env.BASE_URL}"`)
|
||||
|
||||
return {
|
||||
base: process.env.BASE_URL,
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: resolve(__dirname, 'index.html'),
|
||||
login: resolve(__dirname, 'login.html'),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:4000/api',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, ''),
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:4000/api',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user