diff --git a/src/templates/umd-standalone.txt b/src/templates/umd-standalone.txt index 7728689..59b5ca9 100644 --- a/src/templates/umd-standalone.txt +++ b/src/templates/umd-standalone.txt @@ -21,7 +21,7 @@ if (!obj.hasOwnProperty(path)) { obj[path] = fn.apply(null, args); - if (typeof CustomEvent === 'function') { + if (window && typeof CustomEvent === 'function') { window.dispatchEvent(new CustomEvent( @moduleEvent, { detail: { path: path, module: obj[path] } }