Just a reminder to write a documentation for Encore.configureDefinePlugin(), and the integration with Symfony .env files and process.env.*.
Encore.configureDefinePlugin(options => {
options['process.env'].MY_OPTION = JSON.stringify('foo');
});
For example for configuring sentry DNS from .env file:
Encore.configureDefinePlugin(options => {
const env = dotenv.config();
if (env.error) {
throw env.error;
}
options['process.env'].SENTRY_DSN = JSON.stringify(env.parsed.SENTRY_DSN);
});
Just a reminder to write a documentation for
Encore.configureDefinePlugin(), and the integration with Symfony.envfiles andprocess.env.*.For example for configuring sentry DNS from
.envfile: