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

Please include webpack output in NPM distribution #37

Open
feldgendler opened this issue Jul 11, 2017 · 9 comments
Open

Please include webpack output in NPM distribution #37

feldgendler opened this issue Jul 11, 2017 · 9 comments

Comments

@feldgendler
Copy link

Many other libraries include webpacked, minified single-file versions in their NPM distributions. React itself is one of the many such examples.

Can you please add that to the react-inspector NPM?

@ndelangen
Copy link
Member

Sounds reasonable to me.

@kumarabhishek
Copy link
Contributor

If your expectation is to have transpiled and minified single ES5 file then there is small drawback. For example in case you are not using DOMInspector in your code you won't import it in your app thereby including only code that is required and not everything. If we have single file then all code of library is included whether you want or not. Till we get tree-shaking correctly supported by webpack (which does not seems to work for ES6 component classes) we will not get any benefit by having single library file. So its always better to include to import what is required and keep emitted chunk size in control.

@feldgendler
Copy link
Author

Yes, this is exactly what I expect, and I don't mind the file containing parts that I don't use. This is consistent with what happens when one uses a pre-packed React (which is even available on public CDNs that way).

@ndelangen
Copy link
Member

@feldgendler Is it possible for you to submit a PR to add it? I'd suggest compiling to a dist folder using babel.

@feldgendler
Copy link
Author

I started out by trying to produce a webpacked file myself, using “npm build”, but the resulting file caused errors in the browser (can't remember now what it was, looked like something internal to webpack). So I decided that I was doing something wrong, and that you probably know better how to do it.

@feldgendler
Copy link
Author

I mean, I did that before I decided to file this bug.

@billiegoose
Copy link

I second this proposal. I don't have a React app... I just want to use this component to display data for a documentation site I'm making. Am hoping I can just import the UMD versions of React and this with script tags and get it to work somehow.

@billiegoose
Copy link

@feldgendler I bundled the object inspector into a standalone build and published it to the registry: https://npm.im/react-object-inspector-standalone

It's for those use cases where you aren't using React or Webpack, and want to just drop in a script tag and get something working quickly.

@ndelangen
Copy link
Member

@wmhilton I would be happy to accept a PR.

It should:

  • adding a build step that generates this file
  • ignore this file for git
  • add the file to npm
  • add a section to the readme abou usage

Would love to see that PR 🙇

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

No branches or pull requests

4 participants