Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/app/setup-plugin-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ const PLUGINS_DIR = 'plugins-directory';
*/
const DEV_PLUGINS = path.join(os.homedir(), DISTRIBUTION[PLUGINS_DIR]);

/**
* Dev plugins lib directory.
*/
const DEV_PLUGINS_LIB = path.join(DEV_PLUGINS, 'lib');

/**
* @note: The 2nd and 3rd arguments are the root directory and an array
* of packages for the distribution and their relative paths from the
Expand Down Expand Up @@ -66,7 +71,7 @@ const ILLEGAL_MODULES = ['fs', 'net', 'tls', 'child_process'];
*/
Module._load = function(request, loc) {
if (ILLEGAL_MODULES.includes(request)) {
if (loc.filename.includes(DEV_PLUGINS)) {
if (loc.filename.includes(DEV_PLUGINS_LIB)) {
throw new Error(ERROR);
}
}
Expand Down