mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-20 06:55:06 -04: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({
|
.loadEnv({
|
||||||
...import.meta.env,
|
...import.meta.env,
|
||||||
// Because the string 'import.meta.env.PACKAGE_VERSION' is statically replaced during build time (see 'define' in vite.config.ts)
|
// 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()
|
.validate()
|
||||||
.getConfig();
|
.getConfig();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"extends": "@vue/tsconfig/tsconfig.node.json",
|
"extends": "@vue/tsconfig/tsconfig.node.json",
|
||||||
"include": ["vite.config.*"],
|
"include": ["vite.config.*", "./src/config.*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"types": ["node", "vitest"]
|
"types": ["node", "vitest"]
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { configDefaults } from 'vitest/config';
|
||||||
import Icons from 'unplugin-icons/vite';
|
import Icons from 'unplugin-icons/vite';
|
||||||
import IconsResolver from 'unplugin-icons/resolver';
|
import IconsResolver from 'unplugin-icons/resolver';
|
||||||
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
||||||
|
import { config } from './src/config';
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
@ -55,7 +56,7 @@ export default defineConfig({
|
||||||
description: 'Aggregated set of useful tools for developers.',
|
description: 'Aggregated set of useful tools for developers.',
|
||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
lang: 'fr-FR',
|
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',
|
orientation: 'any',
|
||||||
theme_color: '#18a058',
|
theme_color: '#18a058',
|
||||||
background_color: '#f1f5f9',
|
background_color: '#f1f5f9',
|
||||||
|
@ -92,7 +93,7 @@ export default defineConfig({
|
||||||
}),
|
}),
|
||||||
Unocss(),
|
Unocss(),
|
||||||
],
|
],
|
||||||
base: process.env.BASE_URL,
|
base: config.app.baseUrl,
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue