---
title: "Discussion on \"Handling environment variables when Deploying a Static Site with NPM Scripts and Cloudflare Pages\" | Hashnode"
description: "Discussion on \"Handling environment variables when Deploying a Static Site with NPM Scripts and Cloudflare Pages\". Problem\n\nWhen deploying a static site with NPM scripts that utilize bash commands and environment variables inside package.json scripts, you might define something like:\n\n  \"scripts\": {\n    \"transpile-js\": \". .env; for file in \"\\${JS_FILES[@]}\"; do(b..."
url: "https://hashnode.com/posts/handling-environment-variables-when-deploying-a-static-site-with-npm-scripts-and-cloudflare-pages/66cc781687d7e2221e6dc9bc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Handling environment variables when Deploying a Static Site with NPM Scripts and Cloudflare Pages](https://ntheanh201.hashnode.dev/handling-environment-variables-when-deploying-a-static-site-with-npm-scripts-and-cloudflare-pages?utm_source=hashnode&utm_medium=feed)

Problem When deploying a static site with NPM scripts that utilize bash commands and environment variables inside package.json scripts, you might define something like: "scripts": { "transpile-js": ". .env; for file in "\\${JS\_FILES\[@\]}"; do(b...

Aug 26, 2024 · 1 min read · ntheanh201.hashnode.dev  
Read the article

-   [#dotenvx](https://hashnode.com/tag/dotenvx)
-   [#cloudflare](https://hashnode.com/tag/cloudflare)
-   [#static-website](https://hashnode.com/tag/static-website)

## Written by

[The Anh Nguyen](https://hashnode.com/@ntheanh201)

@ntheanh201

  
[View profile](https://hashnode.com/@ntheanh201)

DevOps | Software Engineer | Apache Traffic Control contributor | CKA

I'm interested in designing and building scalable, reliable distributed systems. Dynamic background spanning Software Engineering (Go, NestJS, ReactJS, Spring Boot) to DevOps (GitOps, Kubernetes, Ansible). Experienced in CDN, Cloud: Ionos &amp; AWS services: EC2, Lambda, S3, Amplify, ... Open-source enthusiast, contribute to: Apache Traffic Control (https://github.com/apache/trafficcontrol/pulls?q=is%3Apr+author%3Antheanh201+) Apache Zeppelin (https://github.com/apache/zeppelin/pulls?q=is%3Apr+author%3Antheanh201+)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
