Skip to content

Commit

Permalink
πŸ› Don't depropertize certain Blast properties
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed May 18, 2024
1 parent f43b050 commit 6c23b3e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/server_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,23 @@ module.exports = function serverFunctions(Blast, extras) {
}
}

let var_name = tokens[i - 2];

// Ignore the `Blast.` properties,
// or they can't be used in Terser's `global_defs` option
if (var_name == 'Blast') {
switch (token) {
case 'isBrowser':
case 'isServer':
case 'isNode':
case 'environment':
case 'isProduction':
case 'isDevelopment':
case 'isStaging':
continue;
}
}

if (!is_string) {
token = "'" + token + "'";
} else if (first_char == '"' && !token.includes("'")) {
Expand Down

0 comments on commit 6c23b3e

Please sign in to comment.