diff --git a/index.js b/index.js index 152e777..f8bd824 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,9 @@ * Module dependencies. */ -var Tween = require('tween'); -var raf = require('raf'); +var hasDom = typeof window !== 'undefined'; +var Tween = hasDom ? require('tween') : function() {}; +var raf = hasDom ? require('raf') : function() {}; /** * Expose `scrollTo`.