Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

plugin.ts

12 lines296 Bytes

1import { loadEnv } from 'vite'
2import type { Plugin } from 'vite'
3​
4export function loadEnvPlugin(): Plugin {
5 return {
6 name: 'tanstack-start-core:load-env',
7 enforce: 'pre',
8 configResolved(config) {
9 Object.assign(process.env, loadEnv(config.mode, config.root, ''))
10 },
11 }