refactor: config in sub repo
This commit is contained in:
+8
-4
@@ -4,14 +4,18 @@ import vue from '@vitejs/plugin-vue'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
import { plugin as mdPlugin, Mode } from 'vite-plugin-markdown'
|
||||
|
||||
import articlesConfig from './articles/config.json'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default ({ mode }: { mode: string }) => {
|
||||
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }
|
||||
|
||||
process.env.VITE_APP_TITLE_NO_HTML = process.env.VITE_APP_TITLE?.replace(
|
||||
/(<([^>]+)>)/gi,
|
||||
'',
|
||||
).trim()
|
||||
process.env.VITE_BASE_URL = articlesConfig['base_url']
|
||||
process.env.VITE_APP_TITLE = articlesConfig['title']
|
||||
process.env.VITE_APP_TITLE_NO_HTML = articlesConfig['title'].replace(/(<([^>]+)>)/gi, '').trim()
|
||||
process.env.VITE_APP_LANG = articlesConfig['lang']
|
||||
process.env.VITE_APP_SIGNATURE = articlesConfig['signature']
|
||||
process.env.VITE_CUSTOM_HEAD = articlesConfig['custom_head']
|
||||
|
||||
return defineConfig({
|
||||
plugins: [vue(), vueDevTools(), mdPlugin({ mode: [Mode.HTML] })],
|
||||
|
||||
Reference in New Issue
Block a user