From b080ec883baa123896fbda4dbb1b316fe84c5f8e Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 7 Aug 2019 20:34:38 +0200 Subject: [PATCH] Make Babel preset paths absolute This fixes an issue where a "Cannot find module" error would occur when running the application with a working directory anywhere other than the project root. --- load-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/load-config.js b/load-config.js index af768e3..02084d3 100644 --- a/load-config.js +++ b/load-config.js @@ -10,8 +10,8 @@ module.exports = function (configPath) { (item) => item === absoluteConfigPath, ], presets: [ - "@babel/preset-react", - ["@babel/preset-env", { targets: { node: "current" } }] + require.resolve("@babel/preset-react"), + [require.resolve("@babel/preset-env"), { targets: { node: "current" } }] ] });