inspect-js / object-inspect

string representations of objects in node and the browser
MIT License
142 stars 36 forks source link

Remove dependency to node builtins #38

Closed PFight closed 3 years ago

PFight commented 3 years ago

Using your package I receive troubles:

Rollup: "Creating a browser bundle that depends on Node.js built-in module ('util'). You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills"

Reason is that you require util package in util.inspect.js file.

It is not good to depend on node builtins, so it would be better to remove util dependecy.

ljharb commented 3 years ago

The browser field ensures that the node core module is not used in a bundle. Rollup perhaps has a bug in its browser field implementation.

Separately, a non-broken node module bundler must polyfill node builtins. They will never be removed.