git clone
itcd
into itnpm i
npm run build
npm start
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.js"></script>
</head>
<body>
<script>
define('main', function(require, exports, module) {
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.Worker=e()}}(function(){return function e(r,t,n){function o(f,i){if(!t[f]){if(!r[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(a)return a(f,!0);var s=new Error("Cannot find module '"+f+"'");throw s.code="MODULE_NOT_FOUND",s}var d=t[f]={exports:{}};r[f][0].call(d.exports,function(e){var t=r[f][1][e];return o(t?t:e)},d,d.exports,e,r,t,n)}return t[f].exports}for(var a="function"==typeof require&&require,f=0;f<n.length;f++)o(n[f]);return o}({1:[function(e,r,t){var n=e("webworkify"),o=n(e("./worker.js"));o.addEventListener("message",function(e){console.log(e.data)}),r.exports=o},{"./worker.js":4,webworkify:3}],2:[function(e,r,t){function n(e){if(e<0)return Number("0/0");for(var r=i[0],t=i.length-1;t>0;--t)r+=i[t]/(e+t);var n=e+f+.5;return.5*Math.log(2*Math.PI)+(e+.5)*Math.log(n)-n+Math.log(r)-Math.log(e)}var o=7,a=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],f=607/128,i=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];r.exports=function e(r){if(r<.5)return Math.PI/(Math.sin(Math.PI*r)*e(1-r));if(r>100)return Math.exp(n(r));r-=1;for(var t=a[0],f=1;f<o+2;f++)t+=a[f]/(r+f);var i=r+o+.5;return Math.sqrt(2*Math.PI)*Math.pow(i,r+.5)*Math.exp(-i)*t},r.exports.log=n},{}],3:[function(e,r,t){var n=arguments[3],o=arguments[4],a=arguments[5],f=JSON.stringify;r.exports=function(e,r){for(var t,i=Object.keys(a),u=0,s=i.length;u<s;u++){var d=i[u],l=a[d].exports;if(l===e||l&&l.default===e){t=d;break}}if(!t){t=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var c={},u=0,s=i.length;u<s;u++){var d=i[u];c[d]=d}o[t]=[Function(["require","module","exports"],"("+e+")(self)"),c]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),v={};v[t]=t,o[p]=[Function(["require"],"var f = require("+f(t)+");(f.default ? f.default : f)(self);"),v];var h="("+n+")({"+Object.keys(o).map(function(e){return f(e)+":["+o[e][0]+","+f(o[e][1])+"]"}).join(",")+"},{},["+f(p)+"])",w=window.URL||window.webkitURL||window.mozURL||window.msURL,M=new Blob([h],{type:"text/javascript"});if(r&&r.bare)return M;var g=w.createObjectURL(M),m=new Worker(g);return m.objectURL=g,m}},{}],4:[function(e,r,t){var n=e("gamma");r.exports=function(e){e.addEventListener("message",function(r){var t=parseInt(r.data);setInterval(function(){var r=t/Math.random()-1;e.postMessage([t,r,n(r)])},500)})}},{gamma:2}]},{},[1])(1)});
});
</script>
<script>
require(['main'], function(Worker) {
Worker.postMessage(4); // send the worker a message
});
</script>
</body>
</html>
https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.js