Enable functionExternalModules by default

This commit is contained in:
Nick O'Leary 2021-07-15 10:07:52 +01:00
parent eb4625a0b9
commit 2cc1973f62
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 4 additions and 4 deletions

View File

@ -329,7 +329,7 @@
function getLibsList() {
var _libs = [];
if (RED.settings.functionExternalModules === true) {
if (RED.settings.functionExternalModules !== false) {
var libs = $("#node-input-libs-container").editableList("items");
libs.each(function(i) {
var item = $(this);

View File

@ -100,7 +100,7 @@ module.exports = function(RED) {
node.fin = n.finalize ? n.finalize.trim() : "";
node.libs = n.libs || [];
if (RED.settings.functionExternalModules !== true && node.libs.length > 0) {
if (RED.settings.functionExternalModules === false && node.libs.length > 0) {
throw new Error(RED._("function.error.externalModuleNotAllowed"));
}
@ -500,7 +500,7 @@ module.exports = function(RED) {
RED.nodes.registerType("function",FunctionNode, {
dynamicModuleList: "libs",
settings: {
functionExternalModules: { value: false, exportable: true }
functionExternalModules: { value: true, exportable: true }
}
});
RED.library.register("functions");

View File

@ -396,7 +396,7 @@ module.exports = {
//fileWorkingDirectory: "",
/** Allow the Function node to load additional npm modules directly */
functionExternalModules: false,
functionExternalModules: true,
/** The following property can be used to set predefined values in Global Context.
* This allows extra node modules to be made available with in Function node.