Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit d5f6b00

Browse files
committed
Check for DOM in CSSPluginBase.prototype.instantiate()
1 parent e1ee116 commit d5f6b00

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

css-plugin-base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ CSSPluginBase.prototype.listAssets = function(loads, opts) {
5858
*/
5959
// NB hot reloading support here
6060
CSSPluginBase.prototype.instantiate = function(load) {
61-
if (this.builder)
62-
return;
61+
if (this.builder || typeof document === 'undefined')
62+
return;
6363

6464
var style = document.createElement('style');
6565
style.type = 'text/css';

test/bundle.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ System.registerDynamic("test/data/test.css!css.js", [], false, function ($__requ
44
(function ($__global) {})(this);
55

66
return _retrieveGlobal();
7-
});
8-
(function(c){if (typeof document == 'undefined') return; var d=document,a='appendChild',i='styleSheet',s=d.createElement('style');s.type='text/css';d.getElementsByTagName('head')[0][a](s);s[a](d.createTextNode(c));})
9-
("@import \"./dep.css\";body{background-color:red;background-image:url(test/data/x.png)}\n/*# sourceMappingURL=__.css.map */");
7+
});

0 commit comments

Comments
 (0)