17 lines
		
	
	
		
			637 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			637 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
module.exports = function injectCaller(opts, target) {
 | 
						|
  return Object.assign({}, opts, {
 | 
						|
    caller: Object.assign({
 | 
						|
      name: "babel-loader",
 | 
						|
      // Provide plugins with insight into webpack target.
 | 
						|
      // https://github.com/babel/babel-loader/issues/787
 | 
						|
      target,
 | 
						|
      // Webpack >= 2 supports ESM and dynamic import.
 | 
						|
      supportsStaticESM: true,
 | 
						|
      supportsDynamicImport: true,
 | 
						|
      // Webpack 5 supports TLA behind a flag. We enable it by default
 | 
						|
      // for Babel, and then webpack will throw an error if the experimental
 | 
						|
      // flag isn't enabled.
 | 
						|
      supportsTopLevelAwait: true
 | 
						|
    }, opts.caller)
 | 
						|
  });
 | 
						|
}; |