You can set different wrapping options for dynamically created scripts. For more about wrapping options please check here.
Example
Here we are requesting three.js and some generative art named cubes that depends on three.js. By itself, cubes script does nothing. A controller script is created with on-chain values and it initiates cubes script.
InlineScriptRequest[] memory requests =new InlineScriptRequest[](3);requests[0].name ="three.js";requests[1].name ="cubes";// Calculate this off-chain:uint256 bufferSizeForStoredScripts =100000;bytesmemory controllerScript = abi.encodePacked('let cubes = new Cubes("', LibString.toString(block.timestamp),'");');requests[2].scriptContent = controllerScript;// New buffer size to cover dynamically // created scriptuint256 bufferSize = bufferSizeForStoredScripts + controllerScript.length;bytesmemory htmlFile =IScriptyBuilder( scriptyBuilderAddress).getHTMLInline( requests, controllerScript, bufferSize);
When it's controllerScript becomes something like this: