fix: fix CLI crash + build it on travis

This commit is contained in:
Roman Hotsiy 2018-03-15 22:26:07 +02:00
parent e8609d228a
commit 7769ba84fd
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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",

View File

@ -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;