Skip to content

Commit 7769ba8

Browse files
committed
fix: fix CLI crash + build it on travis
1 parent e8609d2 commit 7769ba8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
addons:
1313
chrome: stable
1414
cache: yarn
15-
before_script: npm run bundle
15+
before_script: npm run bundle && npm run compile:cli
1616
deploy:
1717
- provider: npm
1818
skip_cleanup: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.0.0-alpha.13",
44
"description": "ReDoc",
55
"main": "bundles/redoc.lib.js",
6-
"bin": "bin/cli",
6+
"bin": "bin/cli.js",
77
"scripts": {
88
"start": "webpack-dev-server --hot",
99
"start:benchmark": "webpack-dev-server --env.prod --env.perf",

src/utils/dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function html2Str(html: string): string {
2626

2727
// scrollIntoViewIfNeeded polyfill
2828

29-
if (!(Element as any).prototype.scrollIntoViewIfNeeded) {
29+
if (typeof Element !== 'undefined' && !(Element as any).prototype.scrollIntoViewIfNeeded) {
3030
(Element as any).prototype.scrollIntoViewIfNeeded = function(centerIfNeeded) {
3131
centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
3232

0 commit comments

Comments
 (0)