1.0.6 • Published 2 years ago

vz-vite v1.0.6

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

vz-vite

TODO: description

环境变量加载 loadEnv

import { defineConfig, loadEnv } from 'vite'

export default defineConfig((cmd, mode)=>{
  // Load env file based on `mode` in the current working directory.
  // Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
  const env = loadEnv(mode, process.cwd(), '')
  return {
    // vite config
    define: {
      __APP_ENV__: env.APP_ENV
    }
  }
})