Skip to content

Commit 4f2ce6c

Browse files
committed
Loosen require restrictions to allow for node_modules (#1282)
1 parent e1fb666 commit 4f2ce6c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/setup-plugin-manager.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ const PLUGINS_DIR = 'plugins-directory';
3333
*/
3434
const DEV_PLUGINS = path.join(os.homedir(), DISTRIBUTION[PLUGINS_DIR]);
3535

36+
/**
37+
* Dev plugins lib directory.
38+
*/
39+
const DEV_PLUGINS_LIB = path.join(DEV_PLUGINS, 'lib');
40+
3641
/**
3742
* @note: The 2nd and 3rd arguments are the root directory and an array
3843
* of packages for the distribution and their relative paths from the
@@ -66,7 +71,7 @@ const ILLEGAL_MODULES = ['fs', 'net', 'tls', 'child_process'];
6671
*/
6772
Module._load = function(request, loc) {
6873
if (ILLEGAL_MODULES.includes(request)) {
69-
if (loc.filename.includes(DEV_PLUGINS)) {
74+
if (loc.filename.includes(DEV_PLUGINS_LIB)) {
7075
throw new Error(ERROR);
7176
}
7277
}

0 commit comments

Comments
 (0)