mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Enable functionExternalModules by default
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								packages/node_modules/node-red/settings.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								packages/node_modules/node-red/settings.js
									
									
									
									
										vendored
									
									
								
							@@ -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.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user