From c0bed08546b57f7515900010a22d80acef00d9e1 Mon Sep 17 00:00:00 2001 From: piotr-s-brainhub Date: Wed, 26 Feb 2020 01:43:47 +0100 Subject: [PATCH 1/2] [287] fix undefined window --- .circleci/config.yml | 1 + package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6395114d6..d1fae1810 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,7 @@ jobs: - run: yarn lint - run: yarn test-unit - run: yarn build + - run: node -e "console.log(require('./lib/react-carousel'))" - run: name: publish gh pages for a given PR command: ./tools/deploy-gh-pages-pr.sh diff --git a/package.json b/package.json index 34f015fc8..5580b1757 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brainhubeu/react-carousel", - "version": "1.12.8", + "version": "1.12.9", "description": "Carousel component for React", "engines": { "npm": ">=6.13.7" @@ -12,7 +12,7 @@ "lint": "esw webpack.config.* src tools test --color", "clean-dist": "rimraf ./lib && mkdir lib", "prebuild": "npm run clean-dist", - "build": "node tools/build.js", + "build": "node tools/build.js && mv lib/react-carousel.js 1.js && echo 'if (!global.window) { global.window = {}; }' >> lib/react-carousel.js && cat 1.js >> lib/react-carousel.js && rm 1.js", "selenium-start": "selenium-standalone start", "selenium-install": "selenium-standalone install", "test": "npm run test-unit && npm run test-regression", From 8f3a3a7ffd188b618478416e344439b6fda1d687 Mon Sep 17 00:00:00 2001 From: piotr-s-brainhub Date: Wed, 26 Feb 2020 01:56:32 +0100 Subject: [PATCH 2/2] [287] remove window check from docs-www --- docs-www/src/globalReferences.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs-www/src/globalReferences.js b/docs-www/src/globalReferences.js index 1c0d5bcc0..423997f24 100644 --- a/docs-www/src/globalReferences.js +++ b/docs-www/src/globalReferences.js @@ -1,7 +1,4 @@ const { default: Carousel, Dots } = (() => { - if (!global.window) { - global.window = {}; - } if ('__RC_ENV__' === 'development') { console.log('connecting with local react-carousel source code'); return require('../../src');