When the plugin's webapp bundle is loaded in the frontend, we hit this error that makes the plugin fail to load. Some libraries expect process.env.NODE_ENV to be available during runtime. By default, attempting to access this property results in a null pointer because process is not normally defined in the context of the browser.
This PR configures a webpack plugin that fills in the process.env.NODE_ENV variable in the bundle, to match the value at compilation time. See more here https://stackoverflow.com/a/64553486
Summary
When the plugin's webapp bundle is loaded in the frontend, we hit this error that makes the plugin fail to load. Some libraries expect
process.env.NODE_ENV
to be available during runtime. By default, attempting to access this property results in a null pointer becauseprocess
is not normally defined in the context of the browser.This PR configures a webpack plugin that fills in the
process.env.NODE_ENV
variable in the bundle, to match the value at compilation time. See more here https://stackoverflow.com/a/64553486