Skip to content

Commit

Permalink
fix: add a try/catch to config loading in Paragon Plugin to avoid err…
Browse files Browse the repository at this point in the history
…ors during the build
  • Loading branch information
dcoa committed May 28, 2024
1 parent f59ab9c commit 08849c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/plugins/paragon-webpack-plugin/ParagonWebpackPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ class ParagonWebpackPlugin {
async resolveParagonThemeUrlsFromConfig() {
let envConfig;
if (fs.existsSync(envConfigFile)) {
envConfig = require(envConfigFile);
try {
envConfig = require(envConfigFile);
} catch (error) {
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');
}
}

const paragonThemeUrls = envConfig?.PARAGON_THEME_URLS ?? process.env.PARAGON_THEME_URLS;
Expand Down

0 comments on commit 08849c5

Please sign in to comment.