diff --git a/demo/index.tsx b/demo/index.tsx index 97c0abcf2f..27a43b0732 100644 --- a/demo/index.tsx +++ b/demo/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { render } from 'react-dom'; import styled from 'styled-components'; import { resolve as urlResolve } from 'url'; -import { RedocStandalone } from '../'; +import { RedocStandalone } from '../src'; import ComboBox from './ComboBox'; const demos = [ diff --git a/demo/webpack.config.ts b/demo/webpack.config.ts index 286cc3ed57..8d6b3a9dca 100644 --- a/demo/webpack.config.ts +++ b/demo/webpack.config.ts @@ -28,6 +28,10 @@ export default { resolve: { extensions: ['.ts', '.tsx', '.js', '.json'], }, + + node: { + fs: 'empty', + }, module: { rules: [ @@ -56,6 +60,17 @@ export default { }, }, }, + { + test: /node_modules\/(swagger2openapi|reftools)\/.*\.js$/, + use: { + loader: 'awesome-typescript-loader', + options: { + transpileOnly: true, + allowJs: true, + instance: 'ts2js-transpiler-only', + }, + }, + }, ], }, plugins: [ diff --git a/src/components/SelectOnClick/SelectOnClick.tsx b/src/components/SelectOnClick/SelectOnClick.tsx index d8e3d50394..9856905c2f 100644 --- a/src/components/SelectOnClick/SelectOnClick.tsx +++ b/src/components/SelectOnClick/SelectOnClick.tsx @@ -5,7 +5,7 @@ import { ClipboardService } from '../../services'; export class SelectOnClick extends React.PureComponent { private child: HTMLDivElement | null; handleClick = () => { - ClipboardService.selectElement(this.refs.child); + ClipboardService.selectElement(this.child); }; render() { diff --git a/src/services/OpenAPIParser.ts b/src/services/OpenAPIParser.ts index d4a676df96..1946578ea6 100644 --- a/src/services/OpenAPIParser.ts +++ b/src/services/OpenAPIParser.ts @@ -105,7 +105,7 @@ export class OpenAPIParser { } catch (e) { // do nothing } - return res; + return res || {}; }; /**