diff --git a/.travis.yml b/.travis.yml index d8371dd79a..843e5b4649 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ env: addons: chrome: stable cache: yarn -before_script: npm run bundle +before_script: npm run bundle && npm run compile:cli deploy: - provider: npm skip_cleanup: true diff --git a/package.json b/package.json index 6e60059553..a7965c4096 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "2.0.0-alpha.13", "description": "ReDoc", "main": "bundles/redoc.lib.js", - "bin": "bin/cli", + "bin": "bin/cli.js", "scripts": { "start": "webpack-dev-server --hot", "start:benchmark": "webpack-dev-server --env.prod --env.perf", diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 24ca15f30a..5f50b85f12 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -26,7 +26,7 @@ export function html2Str(html: string): string { // scrollIntoViewIfNeeded polyfill -if (!(Element as any).prototype.scrollIntoViewIfNeeded) { +if (typeof Element !== 'undefined' && !(Element as any).prototype.scrollIntoViewIfNeeded) { (Element as any).prototype.scrollIntoViewIfNeeded = function(centerIfNeeded) { centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;