Skip to content

Commit

Permalink
fix(ui5-tooling-transpile): support special rhino target via env var (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
petermuessig authored Feb 23, 2024
1 parent 332e698 commit 3a0cc03
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions packages/ui5-tooling-transpile/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,16 +441,26 @@ module.exports = function (log) {
configuration?.debug && log.info(`Using external browserslist configuration...`);
} else {
configuration?.debug && log.info(`Using browserslist configuration from ui5.yaml...`);
envPreset.push({
targets: {
// future: consider to read the browserslist config from OpenUI5/SAPUI5?
// env variables must not use "-" or "." and therefore we use "_" only
browsers:
process.env?.["ui5_tooling_transpile__targetBrowsers"] ||
configuration?.targetBrowsers ||
"defaults"
}
});
if (process.env?.["ui5_tooling_transpile__target_rhino"]) {
// necessary to transpile to ES5 for Rhino (to support some legacy Java tools)
envPreset.push({
targets: {
rhino: process.env?.["ui5_tooling_transpile__target_rhino"]
}
});
} else {
envPreset.push({
targets: {
// future: consider to read the browserslist config from OpenUI5/SAPUI5?
// env variables must not use "-" or "." and therefore we use "_" only
browsers:
process.env?.["ui5_tooling_transpile__target_browsers"] ||
process.env?.["ui5_tooling_transpile__targetBrowsers"] ||
configuration?.targetBrowsers ||
"defaults"
}
});
}
}
babelConfigOptions.presets.push(envPreset);

Expand Down

0 comments on commit 3a0cc03

Please sign in to comment.