injectCaller.js 637 B

1234567891011121314151617
  1. module.exports = function injectCaller(opts, target) {
  2. return Object.assign({}, opts, {
  3. caller: Object.assign({
  4. name: "babel-loader",
  5. // Provide plugins with insight into webpack target.
  6. // https://github.com/babel/babel-loader/issues/787
  7. target,
  8. // Webpack >= 2 supports ESM and dynamic import.
  9. supportsStaticESM: true,
  10. supportsDynamicImport: true,
  11. // Webpack 5 supports TLA behind a flag. We enable it by default
  12. // for Babel, and then webpack will throw an error if the experimental
  13. // flag isn't enabled.
  14. supportsTopLevelAwait: true
  15. }, opts.caller)
  16. });
  17. };