babel-loader
Advanced tools
Comparing version 8.0.0-beta.1 to 8.0.0-beta.2
@@ -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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6
0
29556
349
209