Fix swagger ui build (#3091)
Missed that when doing the PR, the default import tries to load the `path` library, recommendation is just to import the right bundle directly.
This commit is contained in:
Родитель
c6506bcdee
Коммит
d4823c089b
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
changeKind: internal
|
||||
packages:
|
||||
- "@typespec/playground"
|
||||
---
|
||||
|
|
@ -12,6 +12,7 @@ const packageJson = JSON.parse(readFileSync(resolve(__dirname, "package.json")).
|
|||
const dependencies = Object.keys(packageJson.dependencies);
|
||||
const external = [
|
||||
...dependencies,
|
||||
"swagger-ui-dist/swagger-ui-es-bundle.js",
|
||||
"swagger-ui-dist/swagger-ui.css",
|
||||
"@typespec/bundler/vite",
|
||||
"react-dom/client",
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { useEffect, useRef } from "react";
|
||||
import { SwaggerUIBundle } from "swagger-ui-dist";
|
||||
// File exists but not describe in the @types package
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
import SwaggerUIBundle from "swagger-ui-dist/swagger-ui-es-bundle.js";
|
||||
|
||||
export default (props: { spec: string }) => {
|
||||
const uiRef = useRef(null);
|
||||
|
|
Загрузка…
Ссылка в новой задаче