SwaggerUI built with Parcel
The latest swagger-ui
working branch is feat/swagger-ui-cjs-as-hooks
The latest swagger-ui-react
working branch is feat/swagger-ui-react-cjs
The prior progressive branches contain a functioning SPA as well.
This project references work from a related repo here, which also contains working branches with detailed explanations for Parcel + swagger-ui-react
, as well as Parcel + swagger-ui
.
npm i
npm start
feat/swagger-ui-cjs-as-globalThis: creates .parcelrc
for css transform exlusion, uses swagger-ui/dist/swagger-ui-es-bundle
in place of true ESM fragment, and uses initializer.js
to instantiate a SwaggerUI instance.
feat/swagger-ui-cjs-as-class: converts from a globalThis instance to a React class component, as well as setting up a Parcel alias for swagger-ui
to use CommonJS bundle.
feat/swagger-ui-cjs-as-hooks: converts from class component to functional component.
feat/swagger-ui-react-cjs: uses swagger-ui-react
, and removes unneeded useEffect
and globalThis
instance.