Package Exports
- vite-plugin-env-compatible
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vite-plugin-env-compatible) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vite-plugin-env-compatible
inject to process.env like vue-cli or create-react-app
Motivation
vite
exposeVITE_XXX
toimport.meta.env.VITE_XXX
, but not loaded to process.env like vue-cli or create-react-app- this plugin support setting prefix like
VUE_APP_
orREACT_APP_
and loaded to process.env - just for compatibility
Usage
yarn add @nibfe/vite-plugin-env-compatible
// vite.config.ts
import envCompatible from 'vite-plugin-env-compatible'
// @see https://vitejs.dev/config/
export default defineConfig({
plugins: [
// ...other plugins
envCompatible()
],
})
Underlying
- dotenv & dotenv-expand
- vite