12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- "use strict";
- const babel = require("@babel/core");
- module.exports = function injectCaller(opts, target) {
- if (!supportsCallerOption()) return opts;
- return Object.assign({}, opts, {
- caller: Object.assign({
- name: "babel-loader",
-
-
- target,
-
- supportsStaticESM: true,
- supportsDynamicImport: true,
-
-
-
- supportsTopLevelAwait: true
- }, opts.caller)
- });
- };
- let supportsCallerOptionFlag = undefined;
- function supportsCallerOption() {
- if (supportsCallerOptionFlag === undefined) {
- try {
-
-
- babel.loadPartialConfig({
- caller: undefined,
- babelrc: false,
- configFile: false
- });
- supportsCallerOptionFlag = true;
- } catch (err) {
- supportsCallerOptionFlag = false;
- }
- }
- return supportsCallerOptionFlag;
- }
|