johtso
03/10/2023, 11:34 PMHardAtWork
03/10/2023, 11:35 PMJames
03/10/2023, 11:36 PM--define SOME_VAR=foo to replace things in code at build timeJames
03/10/2023, 11:37 PMprocess.env.API_KEY, something like --define process.env.API_KEY="foo" should work (or could be accomplished with a custom build)johtso
03/10/2023, 11:38 PMjohtso
03/10/2023, 11:39 PMJames
03/10/2023, 11:39 PMJames
03/10/2023, 11:40 PM--defineJames
03/10/2023, 11:40 PMjohtso
03/10/2023, 11:41 PMjohtso
03/10/2023, 11:41 PMjohtso
03/10/2023, 11:46 PMJames
03/10/2023, 11:46 PMJames
03/10/2023, 11:46 PMjohtso
03/10/2023, 11:46 PMJames
03/10/2023, 11:47 PMdev toojohtso
03/10/2023, 11:47 PMjohtso
03/10/2023, 11:47 PMJames
03/10/2023, 11:48 PMjohtso
03/10/2023, 11:48 PMjohtso
03/10/2023, 11:48 PMprocess.env['FOO'] thingJames
03/10/2023, 11:49 PMjohtso
03/10/2023, 11:49 PMimport { URL } from "node:url";johtso
03/10/2023, 11:50 PMJames
03/10/2023, 11:51 PMdefine: {
'process.env.NODE_ENV': JSON.stringify('production')
},James
03/10/2023, 11:52 PMHardAtWork
03/10/2023, 11:53 PMJames
03/10/2023, 11:54 PM"production" and not just production otherwise your code will treat production as a literal and complain it's undefinedJames
03/10/2023, 11:54 PM'process.env.NODE_ENV': '"production"' hereJames
03/10/2023, 11:54 PM