From 21f99131fd23715606d10b118a48c27e25b77a18 Mon Sep 17 00:00:00 2001 From: Michal Kuklis Date: Tue, 21 Mar 2023 18:59:13 -0400 Subject: [PATCH] STRWEB-69: Check if @folio/stripes path exists before loading it --- webpack/module-paths.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webpack/module-paths.js b/webpack/module-paths.js index 1c612c8..00ea92b 100644 --- a/webpack/module-paths.js +++ b/webpack/module-paths.js @@ -184,9 +184,14 @@ function getModulesPaths(modules) { */ function getStripesModulesPaths() { const packageJsonPath = locatePackageJsonPath('@folio/stripes'); - const packageJson = require(packageJsonPath); const paths = []; + if (!packageJsonPath) { + return paths; + } + + const packageJson = require(packageJsonPath); + if (!packageJson) { return paths; }