All projects

Project journal

Svelte Environment Variables

This is a utility library that lets you securely add environment variables to your frontend project if you’re using SvelteJS and bundling code with Rollup or Webpack. It detects a specific prefix as specified and replaces them in your frontend code with the corresponding environment variable passed to your runtime. You can use env-cmd to make environment variables available to your NodeJS runtime.

Highlights of the project include:

  • Use environment variables in your Svelte frontend project safely
  • Works for Svelte apps bundled with either Rollup or Webpack
  • Works with any NodeJS environment, be it local, cloud or serverless
  • Donate with Coinbase Commerce

Links to Project

Link to NPM package

Link to Github repository


This Project Uses

  • SvelteJS
  • Sapper
  • env-cmd
  • Rollup
  • Webpack
  • Rollup Replace Plugin
  • Webpack Define Plugin
Explore more projects