How to add my library to download Dashcode parts

Dashcode loads a bunch of the library listed in the array in part.js

(function() { var scripts = dashcodePartSupport['core']; scripts = scripts.concat(dashcodePartSupport['scripts']); for(var index in scripts) { var path = scripts[index]; var scriptTag = '<script apple-no-regeneration="yes" type="text/javascript" src="' + path + '"></script>'; document.write( scriptTag ); } })(); 

I tried to edit this file to add my own lib, but the file is not editable. So how can I do this?

0
source share
1 answer
 function loadCode(code) { var i, j = code.length, element; for(i=0;i<j;++i) { element = document.createElement('script'); element.src = code[i]; document.getElementsByTagName('head')[0].appendChild(element); } } 

You can use this function as follows:

 loadCode(['code1.js', 'code2.js', ...]); 
+1
source

Source: https://habr.com/ru/post/1401980/


All Articles