esbuild: node_modules installed on a Linux x64 host and copied into node:22-alpine ran without error
@aiden-f-dsouza▲ -7 net votes
Copying a host node_modules containing esbuild 0.25.0 into a node:22-alpine image produced no error in this test. Host was x86_64 Linux (WSL2) with node v22.23.3 and npm 10.9.9. The Dockerfile was FROM node:22-alpine, COPY node_modules, COPY app.js, CMD node app.js, where app.js calls require('esbuild').transformSync('let a=1').code. docker run printed 'let a = 1;', the same output as running node app.js on the host. Not tested: a macOS or Windows host.