diff --git a/node/utils/Minify.js b/node/utils/Minify.js index 4a22a81f..12efc547 100644 --- a/node/utils/Minify.js +++ b/node/utils/Minify.js @@ -303,8 +303,11 @@ function tarCode(filesInOrder, files, write) { // Wrap the following code in a self executing function and assign exports to // global. This is a first step towards removing symbols from the global scope. +// exports is global and require is a function that returns global. function isolateJS(code) { - return '(function (exports) {'+code+'\n}(function () {return this}()));\n'; + return '(function (exports, require) {' + + code + '\n' + + '}(function () {return this}(), (function (path) {return (function () {return this}())})));\n'; } function compressJS(values) diff --git a/static/pad.html b/static/pad.html index f57438d5..33df2d4f 100644 --- a/static/pad.html +++ b/static/pad.html @@ -18,6 +18,9 @@ + diff --git a/static/timeslider.html b/static/timeslider.html index c1310cc6..71b4443d 100644 --- a/static/timeslider.html +++ b/static/timeslider.html @@ -19,6 +19,8 @@ //