This shows a way to have "environment variables" working for both the webpack-dev-server (local development) and the Divshot server (to test a build locally).
Problem:
- Divshot server expects a
.env.json
file in the project directory, and uses it to serve a__/env.js
file - Webpack dev server can serve static files from the project directory, but we need to create the
__/env.js
file ourselves
A solution: