martinjackson / watch-env

a utility to convert .env file into ./src/initEnv.js that can be included in your front end code so the back end and front end can share project wide constants.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

watch-env

A utility to convert .env file into ./src/initEnv.js that can be included in your front end code so the back end and front end can share project wide constants.


How to use:

run once

npx watch-env

run in the background watching for changes in .env file and creating ./src/initEnv.js

npx watch-env --watch &

Examples of using in you project's package.json:

    "prep": "npx watch-env",
    "watch": "npx watch-env --watch &",
    
    "build": "run-s prep webpack"
    "front": "webpack serve",
    "back": "cd server && ./start.sh",

    "start": "run-s watch back front",
    "prod": "run-s build back"

About

a utility to convert .env file into ./src/initEnv.js that can be included in your front end code so the back end and front end can share project wide constants.

License:MIT License


Languages

Language:JavaScript 99.1%Language:Shell 0.9%