How to use Web Workers into a Module build with Requirejs?
问题 I have a well working app writing with Requirejs and Backbonejs, but it's really slowing sometimes... For example when it comes to make some arithmetic work! I tried to use a Web Worker to do this arithmetic work like this : My Module(traffic.js) : define(["jquery", "use!underscore", "use!backbone", "namespace" ], function ($, _, Backbone, globals) { ..... var worker = new Worker("arithmetic.js"); worker.addEventListener('message', function(e) { console.log(e.data); }, false); worker