parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.38k stars 2.26k forks source link

Support specifying custom inline variable substitutions #9515

Closed jbms closed 3 weeks ago

jbms commented 7 months ago

🙋 feature request

Parcel supports inlining environment variables as process.env.XXXX string values but it does not seem to support inlining arbitrary value types (i.e. not just strings) as arbitrary dotted identifiers (i.e. not necessarily of the form process.env.XXXX).

This is supported by many other bundlers and also by swc: https://swc.rs/docs/configuration/compilation#jsctransformoptimizerglobals https://vitejs.dev/config/shared-options.html#define https://esbuild.github.io/api/#define https://webpack.js.org/plugins/define-plugin/

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.