-
Notifications
You must be signed in to change notification settings - Fork 761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundle for swagger-client
#1120
Comments
@shockey + 1 Would love to see this. Is there a workaround for now? |
There is - you can build your own bundle. Here's how:
If all goes well, you should find a bundle file in |
OMG, awesome! It worked. Thanks for such a fast reply! 😄 |
not so comfy though... |
For the love of God, put that workaround in the README! |
Expanding on @Azuaron comment above.
I struggled with this for a second because later on:
which meant to me: cd node_modules/swagger-client && npm run build-bundle That promptly failed because installing from npm strangely enough only downloaded the dist folder and not the src folder . So had to back out of project folder and use workaround stated above. |
@PaulSearcy, the build instructions only work when you have a full copy of the project (e.g., by Git cloning) - you're not meant to be able to build when you've installed the module via npm 😄 |
@shockey yep, pointing out that the readme makes that assumption. Just from my experience, I've seen JS libraries: do a 1 to 1 with github and npm, provide CDN links, release a bundled browser version usually in UMD ( like one of your to do items listed above), and/or explicitly state to git clone. A minimal material design css library I use called MUI has a great example. I usually first jump into node_modules for the library before I do a git clone so I don't have to switch my focus too much from my editor/terminal/window and usually I can extrapolate what I need from there. I also then don't need to do more clean up tasks down the line when I wonder why I have so many directories in my workspace. 😆 |
FYI, I think the TODO here is
As far as I know, that's all that's required. Since there is no |
Hi @stevage , So i just need to fork and apply the changes you state in the todo and then pull request ? |
@rezpe yes, as far as I know. |
@stevage Done. However, the pull request do not work according to the Jenkins CI job. Strange, since I did not change anything else ... |
It seem readme doc it's not up to date, the command to build for browser is changing from |
As of the next release, a I didn't add a value for the I also passed on hosting the files in the repo - we're likely to phase that out in the other projects in v4.0, so I didn't want to start it here. If there's demand for it, we can set up a GitHub Release asset pipeline that provides the file. Thanks everyone! |
Currently, our other JavaScript projects include browser bundles for folks not using a module bundler (old school!).
swagger-client
doesn't have one, though - there's a Webpack config for it but it's not available downstream.Adding it to the npm module would allow folks to take advantage of tools like unpkg's module cdn and use swagger-client directly in the browser.
TODO
browser
entry topackage.json
The text was updated successfully, but these errors were encountered: