123456789101112131415161718192021222324252627282930313233343536373839 |
- "use strict";
- const babel = require("@babel/core");
- module.exports = function injectCaller(opts) {
- if (!supportsCallerOption()) return opts;
- return Object.assign({}, opts, {
- caller: Object.assign({
- name: "babel-loader",
-
- supportsStaticESM: true,
- supportsDynamicImport: 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;
- }
|