Skip to content

Commit

Permalink
fix :npm-module missing SHADOW_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
thheller committed Apr 28, 2018
1 parent ebc3ad8 commit 7dc90cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/shadow/boot/npm_module.js
@@ -0,0 +1,20 @@
$CLJS.SHADOW_ENV = (function() {
var env = {};

var loadedFiles = {};

env.setLoaded = function(name) {
loadedFiles[name] = true;
};

env.load = function(paths) {
// should never be called
throw new Error("SHADOW_ENV.load not supported!");
};

env.isLoaded = function(name) {
return loadedFiles[name] || false;
}

return env;
})();
1 change: 1 addition & 0 deletions src/main/shadow/build/output.clj
Expand Up @@ -421,6 +421,7 @@
;; set global back to actual global so things like setTimeout work
"\ngoog.global = CLJS_GLOBAL;"

(slurp (io/resource "shadow/boot/npm_module.js"))
(slurp (io/resource "shadow/build/targets/npm_module_goog_overrides.js"))
"\nmodule.exports = $CLJS;\n"
))
Expand Down

0 comments on commit 7dc90cc

Please sign in to comment.