Skip to content

Commit

Permalink
externals handle bad package.json resolution in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
delambo committed May 22, 2024
1 parent 346e076 commit 0871e9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/kyt-core/src/config/externals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
// used to match modules to include in the bundle.
const { userPackageJSONPath } = require('kyt-utils/paths')();

// eslint-disable-next-line import/no-dynamic-require
const pkg = require(userPackageJSONPath);
let pkg;

try {
// eslint-disable-next-line import/no-dynamic-require, global-require
pkg = require(userPackageJSONPath);
} catch (e) {
pkg = {};
}

module.exports = (allowList = []) => {
// Get all of the dependencies from the package.json
Expand Down

0 comments on commit 0871e9e

Please sign in to comment.