Skip to content
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

Webpack UMD build available #136

Merged
merged 4 commits into from
Aug 15, 2016
Merged

Conversation

benwiley4000
Copy link
Contributor

@benwiley4000 benwiley4000 commented Aug 13, 2016

This change adds a webpack build configuration which will create a UMD module of json2csv in the dist/ directory. It's ignored by git, but isn't ignored by npm, so it will be available when downloaded via npm.

I've updated the README as well.

Now dist/json2csv.js can be included with an HTML script tag, if the user is unable to work with javascript modules. All dependencies are included. I don't like this that much, but I'm in a situation where adding webpack or another module packer to the project I'm working on would mean a ton of refactoring. And no other JSON -> CSV String package I've found (that isn't module-only) will let me specify a field order.

NOTE: If this is going to be distributed via npm, it's important that npm run build is run before every release, or dist/json2csv.js will be unavailable or out-of-date.

@knownasilya
Copy link
Collaborator

Could you also add a prepublish script that runs build, so that it isn't forgotten?

@benwiley4000
Copy link
Contributor Author

Oh yeah that sounds great - forgot you could do that. I'll update soon.

Ben

On Aug 13, 2016 9:01 PM, "Ilya Radchenko" [email protected] wrote:

Could you also add a prepublish script that runs build, so that it isn't
forgotten?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#136 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AM7h7Z91WSllWCWLb2x-KHGeasn1n7rDks5qfmjogaJpZM4Jjxzx
.

@benwiley4000
Copy link
Contributor Author

@knownasilya Done. Also, I accidentally wrote earlier that you can use npm build (you actually have to run npm run build) but that's been updated in the README.

@knownasilya knownasilya merged commit ff83ae7 into zemirco:master Aug 15, 2016
knownasilya pushed a commit that referenced this pull request Aug 17, 2016
- Fix crashing on EPIPE error [#134]
- Add UMD build for browser usage [#136]
- Add docs during prepublish
@knownasilya
Copy link
Collaborator

Released as 3.6.3, can you test?

@benwiley4000
Copy link
Contributor Author

@knownasilya Works for me! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants