From aefe583e0dc504e62cecc1a32dc7f70b46434915 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 25 Jun 2017 09:28:37 -0700 Subject: [PATCH] Do not read .babelrc for cache identifier when babelrc=false (#483) --- src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 36c3d641..ca5f2e0d 100644 --- a/src/index.js +++ b/src/index.js @@ -111,9 +111,12 @@ module.exports = function(source, inputSourceMap) { // Handle options const loaderOptions = loaderUtils.getOptions(this) || {}; const fileSystem = this.fs ? this.fs : fs; - const babelrcPath = exists(fileSystem, loaderOptions.babelrc) - ? loaderOptions.babelrc - : resolveRc(fileSystem, path.dirname(filename)); + let babelrcPath = null; + if (loaderOptions.babelrc !== false) { + babelrcPath = exists(fileSystem, loaderOptions.babelrc) + ? loaderOptions.babelrc + : resolveRc(fileSystem, path.dirname(filename)); + } if (babelrcPath) { this.addDependency(babelrcPath);