You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow to require module path from whitelisted dependency
Required module path can be one of
- `fs` (built-in Node.js module),
- `abortcontroller-polyfill` (external main module),
- `abortcontroller-polyfill/dist/cjs-ponyfill` (external submodule).
FastBoot's build system requires only dependency whitelisting,
thus looking only for the first part of module path.
console.warn("[DEPRECATION] Whitelisting module path '"+whitelistedModule+"' will not be supported after fastboot#2.0.0 and it should be removed from the whitelist.");
125
127
126
-
if(existsSync(nodeModulesPath)){
127
-
returnrequire(nodeModulesPath);
128
-
}else{
129
-
// If it's not on disk, assume it's a built-in node package
130
-
returnrequire(moduleName);
128
+
if(whitelist.indexOf(packageName)===-1){
129
+
console.error("Package '"+packageName+"' is required to be in the whitelist.");
131
130
}
132
-
}else{
133
-
thrownewError("Unable to require module '"+moduleName+"' because it was not in the whitelist.");
0 commit comments