Socket
Socket
Sign inDemoInstall

babel-loader

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-loader - npm Package Compare versions

Comparing version 8.0.0-beta.4 to 8.0.0-beta.5

40

lib/transform.js

@@ -20,3 +20,3 @@ "use strict";

try {
result = yield transform(source, options);
result = yield transform(source, injectCaller(options));
} catch (err) {

@@ -58,2 +58,38 @@ throw err.message && err.codeFrame ? new LoaderError(err) : err;

module.exports.version = babel.version;
module.exports.version = babel.version;
function injectCaller(opts) {
if (!supportsCallerOption()) return opts;
return Object.assign({}, opts, {
caller: Object.assign({
name: "babel-loader",
// Webpack >= 2 supports ESM and dynamic import.
supportsStaticESM: true,
supportsDynamicImport: true
}, opts.caller)
});
} // TODO: We can remove this eventually, I'm just adding it so that people have
// a little time to migrate to the newer RCs of @babel/core without getting
// hard-to-diagnose errors about unknown 'caller' options.
let supportsCallerOptionFlag = undefined;
function supportsCallerOption() {
if (supportsCallerOptionFlag === undefined) {
try {
// Rather than try to match the Babel version, we just see if it throws
// when passed a 'caller' flag, and use that to decide if it is supported.
babel.loadPartialConfig({
caller: undefined,
babelrc: false,
configFile: false
});
supportsCallerOptionFlag = true;
} catch (err) {
supportsCallerOptionFlag = false;
}
}
return supportsCallerOptionFlag;
}

2

package.json
{
"name": "babel-loader",
"version": "8.0.0-beta.4",
"version": "8.0.0-beta.5",
"description": "babel module loader for webpack",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc