import-meta-env icon indicating copy to clipboard operation
import-meta-env copied to clipboard

Alternatives for building in air-gapped (offline) environment.

Open bayu01 opened this issue 1 year ago • 2 comments
trafficstars

The Issue: the NPM pkg utility is no longer maintained. I struggled finding ways to "package" inside an offline (air-gapped) environment. By default pkg reaches out to the internet (npm registry). It would be a very tedious process bringing binaries for PKG_CACHE_PATH to build offline.

The Workaround: Resort to a shell script that is able to work offline on an nginx-alpine that performs sed -i "s|\"import_meta_env_placeholder\"|\"$json_object\"|g" ./index.html instead.

Suggested Feature: Is it possible to use Node SEA (Node 21+) to build the executable in an offline environment instead?

bayu01 avatar May 13 '24 18:05 bayu01

You can use Node SEA to build the executable, but be aware that it is still experimental.

soc221b avatar May 17 '24 02:05 soc221b

I wasn't able to figure out the best way to use Node SEA, but it seems like @yao-pkg/pkg is being maintained, so i moved to that 🤷

mckelveygreg avatar Jul 02 '24 05:07 mckelveygreg