M Behzad d3fffd95b6
Add file extension when using absoluteRuntime (#12827)
* fix: add file extention when the absolute path to the runtime files are used (#12824)
the es module imports need the file extention (e.g. import "@babel/runtime/helpers/jsx.js", Or the filenames being listed in the package.json's subpath exports (e.g. "import "@babel/runtime/helpers/jsx" + pkg: "./helpers/jsx": "./helpers/jsx.js"). when the user passes a path via `absoluteRuntime` then the rendered require staemnts is not the module name + subpath which will be resolved via pkg.json but rather the absolute path to the file. for this case, add the file extention / index.js to prevent bundlers from raising a warning.

* Update deps

* Fix imports resolution

* Update fixtures (Windows)

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
2021-11-14 02:03:30 +01:00

55 lines
1.3 KiB
JavaScript

var _asyncToGenerator = require("<CWD>\\packages\\babel-runtime\\helpers\\asyncToGenerator.js");
function test() {
return _test.apply(this, arguments);
}
function _test() {
_test = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
console.log('test');
case 1:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _test.apply(this, arguments);
}
function main() {
return _main.apply(this, arguments);
}
function _main() {
_main = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.t0 = console;
_context2.next = 3;
return test();
case 3:
_context2.t1 = _context2.sent;
_context2.t0.log.call(_context2.t0, _context2.t1);
case 5:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return _main.apply(this, arguments);
}
main();