Skip to content

Commit

Permalink
Add test with polyfill injection
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jan 15, 2024
1 parent 97fc290 commit f234acc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-plugin-proposal-json-modules/package.json
Expand Up @@ -38,7 +38,8 @@
},
"devDependencies": {
"@babel/core": "workspace:^",
"@babel/helper-plugin-test-runner": "workspace:^"
"@babel/helper-plugin-test-runner": "workspace:^",
"babel-plugin-polyfill-corejs3": "^0.8.7"
},
"engines": {
"node": ">=6.9.0"
Expand Down
@@ -0,0 +1,2 @@
import j1 from "./x1.json" with { type: "json" };
import j2 from "./x2.json" with { type: "json" };
@@ -0,0 +1,8 @@
{
"sourceType": "module",
"targets": { "firefox": "41" },
"plugins": [
"proposal-json-modules",
["babel-plugin-polyfill-corejs3", { "method": "usage-pure" }]
]
}
@@ -0,0 +1,3 @@
import _Promise from "core-js-pure/stable/promise/index.js";
import _URL from "core-js-pure/stable/url/index.js";
const [j1, j2] = await _Promise.all([fetch(import.meta.resolve?.("./x1.json") ?? new _URL("./x1.json", import.meta.url)).then(r => r.json()), fetch(import.meta.resolve?.("./x2.json") ?? new _URL("./x2.json", import.meta.url)).then(r => r.json())]);
1 change: 1 addition & 0 deletions yarn.lock
Expand Up @@ -1566,6 +1566,7 @@ __metadata:
"@babel/helper-plugin-test-runner": "workspace:^"
"@babel/helper-plugin-utils": "workspace:^"
"@babel/plugin-syntax-import-attributes": "workspace:^"
babel-plugin-polyfill-corejs3: "npm:^0.8.7"
peerDependencies:
"@babel/core": ^7.22.0
languageName: unknown
Expand Down

0 comments on commit f234acc

Please sign in to comment.