mirror of
https://github.com/CorentinTh/it-tools.git
synced 2024-12-27 10:13:23 +08:00
Import baseUrl from config
This commit is contained in:
parent
54af194d92
commit
73c867ebc8
3 changed files with 6 additions and 4 deletions
|
@ -63,7 +63,8 @@ export const config = figue({
|
|||
.loadEnv({
|
||||
...import.meta.env,
|
||||
// Because the string 'import.meta.env.PACKAGE_VERSION' is statically replaced during build time (see 'define' in vite.config.ts)
|
||||
PACKAGE_VERSION: import.meta.env.PACKAGE_VERSION,
|
||||
PACKAGE_VERSION: import.meta.env?.PACKAGE_VERSION,
|
||||
BASE_URL: import.meta.env?.BASE_URL || process.env.BASE_URL,
|
||||
})
|
||||
.validate()
|
||||
.getConfig();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "@vue/tsconfig/tsconfig.node.json",
|
||||
"include": ["vite.config.*"],
|
||||
"include": ["vite.config.*", "./src/config.*"],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"types": ["node", "vitest"]
|
||||
|
|
|
@ -15,6 +15,7 @@ import { configDefaults } from 'vitest/config';
|
|||
import Icons from 'unplugin-icons/vite';
|
||||
import IconsResolver from 'unplugin-icons/resolver';
|
||||
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
||||
import { config } from './src/config';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
|
@ -55,7 +56,7 @@ export default defineConfig({
|
|||
description: 'Aggregated set of useful tools for developers.',
|
||||
display: 'standalone',
|
||||
lang: 'fr-FR',
|
||||
start_url: `${process.env.BASE_URL}/?utm_source=pwa&utm_medium=pwa`,
|
||||
start_url: `${config.app.baseUrl}/?utm_source=pwa&utm_medium=pwa`,
|
||||
orientation: 'any',
|
||||
theme_color: '#18a058',
|
||||
background_color: '#f1f5f9',
|
||||
|
@ -92,7 +93,7 @@ export default defineConfig({
|
|||
}),
|
||||
Unocss(),
|
||||
],
|
||||
base: process.env.BASE_URL,
|
||||
base: config.app.baseUrl,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
|
|
Loading…
Reference in a new issue