Use nullish coalescing when handling the TESTING
build-target
Given that nullish coalescing is now available in all environments/browser that we support, we can (ever so slightly) simplify handling of the `TESTING` build-target.
This commit is contained in:
parent
ccb72073b0
commit
9e7023776e
15
gulpfile.js
15
gulpfile.js
@ -185,10 +185,7 @@ function createWebpackConfig(
|
|||||||
const bundleDefines = builder.merge(defines, {
|
const bundleDefines = builder.merge(defines, {
|
||||||
BUNDLE_VERSION: versionInfo.version,
|
BUNDLE_VERSION: versionInfo.version,
|
||||||
BUNDLE_BUILD: versionInfo.commit,
|
BUNDLE_BUILD: versionInfo.commit,
|
||||||
TESTING:
|
TESTING: defines.TESTING ?? process.env.TESTING === "true",
|
||||||
defines.TESTING !== undefined
|
|
||||||
? defines.TESTING
|
|
||||||
: process.env.TESTING === "true",
|
|
||||||
DEFAULT_PREFERENCES: defaultPreferencesDir
|
DEFAULT_PREFERENCES: defaultPreferencesDir
|
||||||
? getDefaultPreferences(defaultPreferencesDir)
|
? getDefaultPreferences(defaultPreferencesDir)
|
||||||
: {},
|
: {},
|
||||||
@ -769,10 +766,7 @@ function buildDefaultPreferences(defines, dir) {
|
|||||||
SKIP_BABEL: false,
|
SKIP_BABEL: false,
|
||||||
BUNDLE_VERSION: 0, // Dummy version
|
BUNDLE_VERSION: 0, // Dummy version
|
||||||
BUNDLE_BUILD: 0, // Dummy build
|
BUNDLE_BUILD: 0, // Dummy build
|
||||||
TESTING:
|
TESTING: defines.TESTING ?? process.env.TESTING === "true",
|
||||||
defines.TESTING !== undefined
|
|
||||||
? defines.TESTING
|
|
||||||
: process.env.TESTING === "true",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const inputStream = merge([
|
const inputStream = merge([
|
||||||
@ -1547,10 +1541,7 @@ function buildLib(defines, dir) {
|
|||||||
const bundleDefines = builder.merge(defines, {
|
const bundleDefines = builder.merge(defines, {
|
||||||
BUNDLE_VERSION: versionInfo.version,
|
BUNDLE_VERSION: versionInfo.version,
|
||||||
BUNDLE_BUILD: versionInfo.commit,
|
BUNDLE_BUILD: versionInfo.commit,
|
||||||
TESTING:
|
TESTING: defines.TESTING ?? process.env.TESTING === "true",
|
||||||
defines.TESTING !== undefined
|
|
||||||
? defines.TESTING
|
|
||||||
: process.env.TESTING === "true",
|
|
||||||
DEFAULT_PREFERENCES: getDefaultPreferences(
|
DEFAULT_PREFERENCES: getDefaultPreferences(
|
||||||
defines.SKIP_BABEL ? "lib/" : "lib-legacy/"
|
defines.SKIP_BABEL ? "lib/" : "lib-legacy/"
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user