Can I load AMD modules inside the webmaster?

I am trying to use webmasters to make my computational heavy Javascript truly parallel. However, I have a problem in that all my javascript files are AMD modules. Can I use requirejs inside my website? How?

+4
source share
1 answer

In web services, other scripts can be loaded using the importScripts function. RequireJS source code shows that web workers are also supported:

 // Line 23: isWebWorker = !isBrowser && typeof importScripts !== 'undefined', // Line 1877: } else if (isWebWorker) { //In a web worker, use importScripts. This is not a very //efficient use of importScripts, importScripts will block until //its script is downloaded and evaluated. However, if web workers //are in play, the expectation that a build has been done so that //only one script needs to be loaded anyway. This may need to be //reevaluated if other use cases become common. importScripts(url); 
+7
source

All Articles