diff --git a/programs/develop/webpack/plugin-compilation/env.ts b/programs/develop/webpack/plugin-compilation/env.ts index d5882849..e732f55e 100644 --- a/programs/develop/webpack/plugin-compilation/env.ts +++ b/programs/develop/webpack/plugin-compilation/env.ts @@ -67,15 +67,14 @@ export class EnvPlugin { // Ensure default environment variables are always available: // - EXTENSION_PUBLIC_BROWSER - // - EXTENSION_PUBLIC_ENV_MODE + // - EXTENSION_PUBLIC_MODE filteredEnvVars['process.env.EXTENSION_PUBLIC_BROWSER'] = JSON.stringify( this.browser ) filteredEnvVars['import.meta.env.EXTENSION_PUBLIC_BROWSER'] = JSON.stringify(this.browser) - filteredEnvVars['process.env.EXTENSION_PUBLIC_ENV_MODE'] = - JSON.stringify(mode) - filteredEnvVars['import.meta.env.EXTENSION_PUBLIC_ENV_MODE'] = + filteredEnvVars['process.env.EXTENSION_PUBLIC_MODE'] = JSON.stringify(mode) + filteredEnvVars['import.meta.env.EXTENSION_PUBLIC_MODE'] = JSON.stringify(mode) // Apply DefinePlugin to expose filtered variables @@ -101,7 +100,7 @@ export class EnvPlugin { // Replace environment variables in the format $EXTENSION_PUBLIC_VAR fileContent = fileContent.replace( - /$EXTENSION_PUBLIC_[A-Z_]+/g, + /\$EXTENSION_PUBLIC_[A-Z_]+/g, (match) => { const envVarName = match.slice(1) // Remove the '$' const value = combinedVars[envVarName] || match