Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.1 to 8.0.0-beta.2

10

lib/index.js

@@ -36,2 +36,6 @@ var fs = require("fs");

if ("forceEnv" in options) {
console.warn("The option `forceEnv` has been removed in favor of `envName` in Babel 7.");
}
if (typeof options.babelrc === "string") {

@@ -41,4 +45,4 @@ console.warn("The option `babelrc` should not be set to a string anymore in the babel-loader config. " + "Please update your configuration and set `babelrc` to true or false.\n" + "If you want to specify a specific babel config file to inherit config from " + "please use the `extends` option.\nFor more information about this options see " + "https://babeljs.io/docs/core-packages/#options");

if (options.babelrc !== false && options.extends) {
babelrc = exists(fs, options.extends) ? options.extends : rc(fs, path.dirname(filename));
if (options.babelrc !== false) {
babelrc = options.extends && exists(fs, options.extends) ? options.extends : rc(fs, path.dirname(filename));
}

@@ -55,3 +59,3 @@

cacheIdentifier: JSON.stringify({
env: options.forceEnv || process.env.BABEL_ENV || process.env.NODE_ENV || "development",
env: options.envName || process.env.BABEL_ENV || process.env.NODE_ENV || "development",
options,

@@ -58,0 +62,0 @@ babelrc: babelrc ? read(fs, babelrc) : null,

@@ -5,19 +5,4 @@ var babel = require("@babel/core");

function env(prev) {
if (prev === undefined) delete process.env.BABEL_ENV;else process.env.BABEL_ENV = prev;
}
module.exports = function (source, options, cb) {
var forceEnv = options.forceEnv;
delete options.forceEnv;
var tmpEnv;
if (forceEnv) {
tmpEnv = process.env.BABEL_ENV;
process.env.BABEL_ENV = forceEnv;
}
babel.transform(source, options, function (err, result) {
if (forceEnv) env(tmpEnv);
if (err) {

@@ -24,0 +9,0 @@ return err.message && err.codeFrame ? cb(new LoaderError(err)) : cb(err);

{
"name": "babel-loader",
"version": "8.0.0-beta.1",
"version": "8.0.0-beta.2",
"description": "babel module loader for webpack",

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

@@ -91,4 +91,2 @@ > This readme is for babel-loader v8 + Babel v7

* `forceEnv`: Default will resolve BABEL_ENV then NODE_ENV. Allow you to override BABEL_ENV/NODE_ENV at the loader level. Useful for isomorphic applications with different babel configuration for client and server.
* `babelrc`: Default `true`. When `false`, no options from `.babelrc` files will be used; only the options passed to

@@ -95,0 +93,0 @@ `babel-loader` will be used.

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