Setup enviroment stuff.
This commit is contained in:
1
frontend/.env.dev
Normal file
1
frontend/.env.dev
Normal file
@@ -0,0 +1 @@
|
||||
VITE_API_TARGET=ASDF
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "rushstats",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "cross-env NODE_OPTIONS='--no-warnings' vite",
|
||||
"dev": "cross-env NODE_OPTIONS='--no-warnings' vite --mode dev",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-container><div>potato</div></v-container>
|
||||
<v-container><div>potato</div><div>asdf{{potato}}{{butts}}</div></v-container>
|
||||
<v-table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -20,5 +20,10 @@
|
||||
<script setup lang="ts">
|
||||
import { Game, useGameStore } from '../store/gamestore'
|
||||
|
||||
const potato = import.meta.env
|
||||
// const butts = import.meta.env.dev
|
||||
const butts = import.meta.env.VITE_API_TARGET
|
||||
const games = useGameStore()
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -8,11 +8,13 @@ import VueRouter from 'unplugin-vue-router/vite'
|
||||
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
|
||||
|
||||
// Utilities
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
export default ({mode}) => {
|
||||
process.env = {...process.env, ...loadEnv(mode, process.cwd())}
|
||||
return defineConfig({
|
||||
plugins: [
|
||||
VueRouter(),
|
||||
Layouts(),
|
||||
@@ -65,4 +67,4 @@ export default defineConfig({
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
})
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user