Nodular Pudding Multiverse

    vite-plugin-env-compatible
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.1 • Public • Published

    vite-plugin-env-compatible

    inject to process.env like vue-cli or create-react-app

    wakatime NPM Publish downloads npm version License: MIT

    Motivation

    • vite expose VITE_XXX to import.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_ or REACT_APP_ and loaded to process.env
    • just for compatibility

    Usage

    yarn add 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(/* options */)
      ],
    })

    Options

    Underlying

    • dotenv & dotenv-expand
    • vite

    Further

    Install

    npm i vite-plugin-env-compatible

    DownloadsWeekly Downloads

    18,931

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    13.3 kB

    Total Files

    4

    Last publish

    Collaborators

    • indexxuan