@snowpack/plugin-dotenv

    2.2.0 • Public • Published

    @snowpack/plugin-dotenv

    Use dotenv to load environment variables from your project .env files. See Snowpack's Environment Variables documentation to learn more.

    npm install --save-dev @snowpack/plugin-dotenv
    
    // snowpack.config.mjs
    export default {
      plugins: ['@snowpack/plugin-dotenv'],
    };
    # .env
    SNOWPACK_PUBLIC_ENABLE_FEATURE=true
    

    NOTE: Snowpack requires the SNOWPACK_PUBLIC_ prefix to recognize environment variables. This is to prevent accidental exposure of keys and secrets.

    What is Supported?

    • dotenv-expand
    • .env.NODE_ENV.local
    • .env.local
    • .env.NODE_ENV
    • .env

    Plugin Options

    Name Type Description
    dir string (optional) Where to find .env files. Default is your current working directory (process.cwd())
    expand boolean (optional) Enable dotenv-expand support. Default is true

    Keywords

    none

    Install

    npm i @snowpack/plugin-dotenv

    DownloadsWeekly Downloads

    12,499

    Version

    2.2.0

    License

    MIT

    Unpacked Size

    15.2 kB

    Total Files

    23

    Last publish

    Collaborators

    • fredkschott
    • drewpowers