swagger-ui-bundle.js and swagger-ui-standalone-preset.js not shipped with swagger-ui
See original GitHub issueI want to create a simple html page that use SwaggerUIBundle js class to setup the swagger ui interface, as demonstrated in this exemple.
I’m using webpack to package my project and all it’s dependencies.
When installing swagger-ui from npm, these two files are not installed (they seams to be excluded from the npm package through the .npmignore file) :
- swagger-ui-bundle.js
- swagger-ui-standalone-preset.js
Without these files i’m not able to reproduce the provided exemple.
The only solution i found was to import SwaggerUIBundle and SwaggerUIStandalonePreset from the swagger-ui-dist package instead of the swagger-ui.
I found the doc a bit unclear about which package to use:
swagger-ui is a traditional npm module intended for use in JavaScript web application projects that are capable of resolving dependencies (via Webpack, Browserify, etc).
This sentence sounds like i should use swagger-ui and not swagger-ui-dist in my situation.
I guess i’m not doing things the right way.
Which package should be effectivly installed ?
Thanks you
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Related StackOverflow Question
I just ended up installing the
swagger-ui-distpackage, as it was easiest to get working.Hmm - yeah, I don’t see any reason to not put the Standalone plugin into
swagger-ui.It was originally excluded based on the thought that most consumers would be embedding Swagger-UI into larger applications, and would have no use for the Topbar.
I’ll circle back on this before the end of the week, but if any of you want to beat me to a PR that would be fine 😉
Also, an FYI! If you’re using a module bundler, your app bundle will be significantly smaller if you use
swagger-uiinstead ofswagger-ui-dist.