0.1.8 • Published 8 months ago

@dwidge/buildy v0.1.8

Weekly downloads
-
License
BSL-1.0
Repository
-
Last release
8 months ago

@dwidge/buildy

Simple esbuild with filtered env.

Use env-cmd or dotenv/config for .env files, cross-env for package scripts.

usage

pnpm i -D @dwidge/buildy env-cmd http-server
"scripts": {
    "dev": "servey src=src/index.tsx env=\"REACT_APP_ REACT_APP_DEV_\" dir=public port=3000",
    "build": "buildy src=src/index.tsx env=REACT_APP_ dir=public out=build meta=tmp/meta.json",
    "start": "pnpx http-server build -o -p3000"
}

dev server

pnpm dev

dev server with .env.dev file

pnpm env-cmd -f .env.dev pnpm dev

build with .env file and serve static

pnpm env-cmd pnpm build
pnpm start

src/index.tsx

console.log("process.env", process.env);

cli

> REACT_APP_API=http://localhost:4444 OTHER_ENV=12345 pnpm dev

process.env { REACT_APP_API: "http://localhost:4444" }
0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago