Fix environment variable injection (#15318)

The environment variables `IN_TEST` and `METAMASK_DEBUG` were not
being set to `false` correctly. Instead those variables were being
skipped, and were resolved to `undefined` at runtime. This is confusing
because the other environment variables do not work that way - they can
be set to false.

The build script has been updated to ensure those two environment
variables are always set to `true` or `false` - never `undefined`.

Additionally, the `METAMASK_VERSION` environment variable was being
omitted from the `app-init.js` bundle. For the sake of consistency,
that has also been restored.
feature/default_network_editable
Mark Stacey 2 years ago committed by GitHub
parent e280204287
commit 2bcc1c512c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      development/build/scripts.js

@ -219,7 +219,11 @@ function createScriptTasks({
const { dev, test, testDev, prod } = core;
return { dev, test, testDev, prod };
function createTasksForScriptBundles({ taskPrefix, devMode, testing }) {
function createTasksForScriptBundles({
taskPrefix,
devMode = false,
testing = false,
}) {
const standardEntryPoints = ['background', 'ui', 'content-script'];
const standardSubtask = createTask(
`${taskPrefix}:standardEntryPoints`,
@ -401,6 +405,7 @@ async function createManifestV3AppInitializationBundle({
policyOnly,
shouldLintFenceFiles,
applyLavaMoat,
version,
}) {
const label = 'app-init';
// TODO: remove this filter for firefox once MV3 is supported in it
@ -423,6 +428,7 @@ async function createManifestV3AppInitializationBundle({
testing,
policyOnly,
shouldLintFenceFiles,
version,
})();
postProcessServiceWorker(
@ -632,6 +638,7 @@ function createFactoredBuild({
policyOnly,
shouldLintFenceFiles,
applyLavaMoat,
version,
});
}
break;

Loading…
Cancel
Save