mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Merge pull request #12887 from Snuffleupagus/keep-logical-assignment-operators
Keep logical assignment operators in `MOZCENTRAL`/`TESTING`-builds
This commit is contained in:
commit
25d84e4c40
1 changed files with 18 additions and 11 deletions
29
gulpfile.js
29
gulpfile.js
|
@ -209,6 +209,23 @@ function createWebpackConfig(
|
||||||
}
|
}
|
||||||
const babelExcludeRegExp = new RegExp(`(${babelExcludes.join("|")})`);
|
const babelExcludeRegExp = new RegExp(`(${babelExcludes.join("|")})`);
|
||||||
|
|
||||||
|
// Since logical assignment operators is a fairly new ECMAScript feature,
|
||||||
|
// for now we translate these regardless of the `SKIP_BABEL` value (with the
|
||||||
|
// exception of `MOZCENTRAL`/`TESTING`-builds where this isn't an issue).
|
||||||
|
const babelPlugins = [
|
||||||
|
"@babel/plugin-transform-modules-commonjs",
|
||||||
|
[
|
||||||
|
"@babel/plugin-transform-runtime",
|
||||||
|
{
|
||||||
|
helpers: false,
|
||||||
|
regenerator: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
];
|
||||||
|
if (!bundleDefines.MOZCENTRAL && !bundleDefines.TESTING) {
|
||||||
|
babelPlugins.push("@babel/plugin-proposal-logical-assignment-operators");
|
||||||
|
}
|
||||||
|
|
||||||
const plugins = [];
|
const plugins = [];
|
||||||
if (!disableLicenseHeader) {
|
if (!disableLicenseHeader) {
|
||||||
plugins.push(
|
plugins.push(
|
||||||
|
@ -241,17 +258,7 @@ function createWebpackConfig(
|
||||||
exclude: babelExcludeRegExp,
|
exclude: babelExcludeRegExp,
|
||||||
options: {
|
options: {
|
||||||
presets: skipBabel ? undefined : ["@babel/preset-env"],
|
presets: skipBabel ? undefined : ["@babel/preset-env"],
|
||||||
plugins: [
|
plugins: babelPlugins,
|
||||||
"@babel/plugin-proposal-logical-assignment-operators",
|
|
||||||
"@babel/plugin-transform-modules-commonjs",
|
|
||||||
[
|
|
||||||
"@babel/plugin-transform-runtime",
|
|
||||||
{
|
|
||||||
helpers: false,
|
|
||||||
regenerator: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue