From 94df6d3e8e9d8f485a4d9936f22d278b5bf1e8dc Mon Sep 17 00:00:00 2001 From: Pavel Nezhencev Date: Sat, 1 Dec 2018 12:28:07 +0200 Subject: [PATCH] Fix ssr --- build/iscroll-infinite.js | 6 +++++- build/iscroll-lite.js | 6 +++++- build/iscroll-probe.js | 6 +++++- build/iscroll-zoom.js | 6 +++++- build/iscroll.js | 6 +++++- src/open.js | 4 ++++ 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/build/iscroll-infinite.js b/build/iscroll-infinite.js index 41486e4c..055c09f2 100644 --- a/build/iscroll-infinite.js +++ b/build/iscroll-infinite.js @@ -1,4 +1,8 @@ -/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.2.0-snapshot ~ (c) 2008-2018 Matteo Spinelli ~ http://cubiq.org/license */ +if (typeof window == 'undefined' && typeof module != 'undefined') + module.exports = { __disabled: 'No SSR support' }; +else + (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || diff --git a/build/iscroll-lite.js b/build/iscroll-lite.js index 27dc170e..f70bc25c 100644 --- a/build/iscroll-lite.js +++ b/build/iscroll-lite.js @@ -1,4 +1,8 @@ -/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.2.0-snapshot ~ (c) 2008-2018 Matteo Spinelli ~ http://cubiq.org/license */ +if (typeof window == 'undefined' && typeof module != 'undefined') + module.exports = { __disabled: 'No SSR support' }; +else + (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || diff --git a/build/iscroll-probe.js b/build/iscroll-probe.js index 68e9e43a..bb7ff5c3 100644 --- a/build/iscroll-probe.js +++ b/build/iscroll-probe.js @@ -1,4 +1,8 @@ -/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.2.0-snapshot ~ (c) 2008-2018 Matteo Spinelli ~ http://cubiq.org/license */ +if (typeof window == 'undefined' && typeof module != 'undefined') + module.exports = { __disabled: 'No SSR support' }; +else + (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || diff --git a/build/iscroll-zoom.js b/build/iscroll-zoom.js index cff02bf4..39323974 100644 --- a/build/iscroll-zoom.js +++ b/build/iscroll-zoom.js @@ -1,4 +1,8 @@ -/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.2.0-snapshot ~ (c) 2008-2018 Matteo Spinelli ~ http://cubiq.org/license */ +if (typeof window == 'undefined' && typeof module != 'undefined') + module.exports = { __disabled: 'No SSR support' }; +else + (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || diff --git a/build/iscroll.js b/build/iscroll.js index 3c926627..fbc6cf76 100644 --- a/build/iscroll.js +++ b/build/iscroll.js @@ -1,4 +1,8 @@ -/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.2.0-snapshot ~ (c) 2008-2018 Matteo Spinelli ~ http://cubiq.org/license */ +if (typeof window == 'undefined' && typeof module != 'undefined') + module.exports = { __disabled: 'No SSR support' }; +else + (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || diff --git a/src/open.js b/src/open.js index d0df6c40..47f370b1 100644 --- a/src/open.js +++ b/src/open.js @@ -1 +1,5 @@ +if (typeof window == 'undefined' && typeof module != 'undefined') + module.exports = { __disabled: 'No SSR support' }; +else + (function (window, document, Math) {