-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ | |
}, | ||
"devDependencies": { | ||
"@babel/core": "workspace:*", | ||
"@babel/core-7.12": "npm:@babel/[email protected]", | ||
"@babel/helper-plugin-test-runner": "workspace:*", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.3" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
//@flow | ||
|
||
import { SemVer } from "semver"; | ||
import { SemVer, lt } from "semver"; | ||
import { logPluginOrPolyfill } from "./debug"; | ||
import getOptionSpecificExcludesFor from "./get-option-specific-excludes"; | ||
import { removeUnnecessaryItems } from "./filter-items"; | ||
|
@@ -295,6 +295,10 @@ export default declare((api, opts) => { | |
let targets = babelTargets; | ||
|
||
if ( | ||
// @babel/core < 7.13.0 doesn't load targets (api.targets() always | ||
// returns {} thanks to @babel/helper-plugin-utils), so we always want | ||
// to fallback to the old targets behavior in this case. | ||
lt(api.version, "7.13.0") || | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
fabiooshiro
via email
|
||
// If any browserslist-related option is specified, fallback to the old | ||
// behavior of not using the targets specified in the top-level options. | ||
opts.targets || | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as babel7_12 from "@babel/core"; | ||
import env from ".."; | ||
import path from "path"; | ||
|
||
describe("#12880", () => { | ||
it("read the .browserslistrc file when using @babel/core < 7.13.0", () => { | ||
// The browserslistrc file contains "firefox 50". | ||
// a ** b is supported starting from firefox 52; | ||
// a => b is supported starting from firefox 45. | ||
const out = babel7_12.transformSync("a ** b; a => b;", { | ||
configFile: false, | ||
presets: [[env, { modules: false }]], | ||
filename: path.join(__dirname, "regressions", "input.js"), | ||
}); | ||
|
||
expect(out.code).toMatchInlineSnapshot(` | ||
"Math.pow(a, b); | ||
a => b;" | ||
`); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
firefox 50 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,30 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/core-7.12@npm:@babel/[email protected]": | ||
version: 7.12.9 | ||
resolution: "@babel/core@npm:7.12.9" | ||
dependencies: | ||
"@babel/code-frame": ^7.10.4 | ||
"@babel/generator": ^7.12.5 | ||
"@babel/helper-module-transforms": ^7.12.1 | ||
"@babel/helpers": ^7.12.5 | ||
"@babel/parser": ^7.12.7 | ||
"@babel/template": ^7.12.7 | ||
"@babel/traverse": ^7.12.9 | ||
"@babel/types": ^7.12.7 | ||
convert-source-map: ^1.7.0 | ||
debug: ^4.1.0 | ||
gensync: ^1.0.0-beta.1 | ||
json5: ^2.1.2 | ||
lodash: ^4.17.19 | ||
resolve: ^1.3.2 | ||
semver: ^5.4.1 | ||
source-map: ^0.5.0 | ||
checksum: beefb9f490cfff7cafc02e5a11148297a71260ee18f5fdf6e14bf5694bc28431eec3813a91d0f0fc8c6122c5133d90d3261dadf45cb914d7d340a5b3077fd9bd | ||
languageName: node | ||
linkType: hard | ||
|
||
"@babel/core@npm:7.13.1, @babel/core@npm:^7.1.0, @babel/core@npm:^7.13.1, @babel/core@npm:^7.7.5": | ||
version: 7.13.1 | ||
resolution: "@babel/core@npm:7.13.1" | ||
|
@@ -285,7 +309,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/generator@npm:^7.13.0": | ||
"@babel/generator@npm:^7.12.5, @babel/generator@npm:^7.13.0": | ||
version: 7.13.0 | ||
resolution: "@babel/generator@npm:7.13.0" | ||
dependencies: | ||
|
@@ -619,7 +643,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/helper-module-transforms@npm:^7.12.13, @babel/helper-module-transforms@npm:^7.13.0": | ||
"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.12.13, @babel/helper-module-transforms@npm:^7.13.0": | ||
version: 7.13.0 | ||
resolution: "@babel/helper-module-transforms@npm:7.13.0" | ||
dependencies: | ||
|
@@ -857,7 +881,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/helpers@npm:^7.13.0": | ||
"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.13.0": | ||
version: 7.13.0 | ||
resolution: "@babel/helpers@npm:7.13.0" | ||
dependencies: | ||
|
@@ -926,7 +950,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/parser@npm:^7.0.0, @babel/parser@npm:^7.12.13, @babel/parser@npm:^7.13.0": | ||
"@babel/parser@npm:^7.0.0, @babel/parser@npm:^7.12.13, @babel/parser@npm:^7.12.7, @babel/parser@npm:^7.13.0": | ||
version: 7.13.4 | ||
resolution: "@babel/parser@npm:7.13.4" | ||
bin: | ||
|
@@ -3039,6 +3063,7 @@ __metadata: | |
dependencies: | ||
"@babel/compat-data": "workspace:^7.13.8" | ||
"@babel/core": "workspace:*" | ||
"@babel/core-7.12": "npm:@babel/[email protected]" | ||
"@babel/helper-compilation-targets": "workspace:^7.13.8" | ||
"@babel/helper-plugin-test-runner": "workspace:*" | ||
"@babel/helper-plugin-utils": "workspace:^7.13.0" | ||
|
@@ -3369,7 +3394,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/template@npm:^7.12.13, @babel/template@npm:^7.3.3": | ||
"@babel/template@npm:^7.12.13, @babel/template@npm:^7.12.7, @babel/template@npm:^7.3.3": | ||
version: 7.12.13 | ||
resolution: "@babel/template@npm:7.12.13" | ||
dependencies: | ||
|
@@ -3400,7 +3425,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/traverse@npm:^7.0.0, @babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.13.0": | ||
"@babel/traverse@npm:^7.0.0, @babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.13.0": | ||
version: 7.13.0 | ||
resolution: "@babel/traverse@npm:7.13.0" | ||
dependencies: | ||
|
@@ -3434,7 +3459,7 @@ __metadata: | |
languageName: unknown | ||
linkType: soft | ||
|
||
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.13, @babel/types@npm:^7.13.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": | ||
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.1, @babel/types@npm:^7.12.13, @babel/types@npm:^7.12.7, @babel/types@npm:^7.13.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4": | ||
version: 7.13.0 | ||
resolution: "@babel/types@npm:7.13.0" | ||
dependencies: | ||
|
@@ -8379,7 +8404,7 @@ fsevents@^1.2.7: | |
languageName: node | ||
linkType: hard | ||
|
||
"gensync@npm:^1.0.0-beta.2": | ||
"gensync@npm:^1.0.0-beta.1, gensync@npm:^1.0.0-beta.2": | ||
version: 1.0.0-beta.2 | ||
resolution: "gensync@npm:1.0.0-beta.2" | ||
checksum: d523437689c97b3aba9c5cdeca4677d5fff9a29d620db693fea40d852bad63563110f16979d0170248439dbcd2ecee0780fb2533d3f0519f019081aa10767c60 | ||
|
@@ -12829,7 +12854,7 @@ fsevents@^1.2.7: | |
languageName: node | ||
linkType: hard | ||
|
||
"resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.4.0, resolve@^1.9.0": | ||
"resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.9.0": | ||
version: 1.20.0 | ||
resolution: "resolve@npm:1.20.0" | ||
dependencies: | ||
|
@@ -12839,7 +12864,7 @@ fsevents@^1.2.7: | |
languageName: node | ||
linkType: hard | ||
|
||
"resolve@patch:resolve@^1.1.4#builtin<compat/resolve>, resolve@patch:resolve@^1.1.6#builtin<compat/resolve>, resolve@patch:resolve@^1.1.7#builtin<compat/resolve>, resolve@patch:resolve@^1.10.0#builtin<compat/resolve>, resolve@patch:resolve@^1.13.1#builtin<compat/resolve>, resolve@patch:resolve@^1.14.2#builtin<compat/resolve>, resolve@patch:resolve@^1.17.0#builtin<compat/resolve>, resolve@patch:resolve@^1.18.1#builtin<compat/resolve>, resolve@patch:resolve@^1.19.0#builtin<compat/resolve>, resolve@patch:resolve@^1.4.0#builtin<compat/resolve>, resolve@patch:resolve@^1.9.0#builtin<compat/resolve>": | ||
"resolve@patch:resolve@^1.1.4#builtin<compat/resolve>, resolve@patch:resolve@^1.1.6#builtin<compat/resolve>, resolve@patch:resolve@^1.1.7#builtin<compat/resolve>, resolve@patch:resolve@^1.10.0#builtin<compat/resolve>, resolve@patch:resolve@^1.13.1#builtin<compat/resolve>, resolve@patch:resolve@^1.14.2#builtin<compat/resolve>, resolve@patch:resolve@^1.17.0#builtin<compat/resolve>, resolve@patch:resolve@^1.18.1#builtin<compat/resolve>, resolve@patch:resolve@^1.19.0#builtin<compat/resolve>, resolve@patch:resolve@^1.3.2#builtin<compat/resolve>, resolve@patch:resolve@^1.4.0#builtin<compat/resolve>, resolve@patch:resolve@^1.9.0#builtin<compat/resolve>": | ||
version: 1.20.0 | ||
resolution: "resolve@patch:resolve@npm%3A1.20.0#builtin<compat/resolve>::version=1.20.0&hash=3388aa" | ||
dependencies: | ||
|
@@ -13165,7 +13190,7 @@ fsevents@^1.2.7: | |
languageName: node | ||
linkType: hard | ||
|
||
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.0": | ||
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.4.1, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.0": | ||
version: 5.7.1 | ||
resolution: "semver@npm:5.7.1" | ||
bin: | ||
|
hi @nicolo-ribaudo I think that change is braking the parcel-bundler, because the parcel does not pass the api.version
If there is no api.version it should be evaluated as false?