Skip to content

Commit 08849c5

Browse files
committed
fix: add a try/catch to config loading in Paragon Plugin to avoid errors during the build
1 parent f59ab9c commit 08849c5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/plugins/paragon-webpack-plugin/ParagonWebpackPlugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ class ParagonWebpackPlugin {
5757
async resolveParagonThemeUrlsFromConfig() {
5858
let envConfig;
5959
if (fs.existsSync(envConfigFile)) {
60-
envConfig = require(envConfigFile);
60+
try {
61+
envConfig = require(envConfigFile);
62+
} catch (error) {
63+
console.info('Paragon Plugin cannot load env.config file, if you want to preload the theme url be sure your file is a CommonJS module');
64+
}
6165
}
6266

6367
const paragonThemeUrls = envConfig?.PARAGON_THEME_URLS ?? process.env.PARAGON_THEME_URLS;

0 commit comments

Comments
 (0)