benjamine / jsondiffpatch

Diff & patch JavaScript objects
MIT License
4.79k stars 466 forks source link

Fix UMD builds #228

Closed popojargo closed 6 years ago

popojargo commented 6 years ago

Current state

With the current UMD builds, external modules where still required. If they were importer in an HTML page, the require("...") calls would fail and fallback to default values.

Problem

When developing an browser application with another bundler, it will bundle external dependencies from the "node_modules" folder.

Proposal

I added a new devDependency which is rollup-plugin-hypothetical. This new plugin allows us to map sources files to import statements.

In our case, I mapped external dependencies to null function.

Related issue

220

benjamine commented 6 years ago

oh interesting, thanks @popojargo ! will give it a try, sounds good 👍

popojargo commented 6 years ago

@benjamine Can you give me an estimate of when you'll review this PR?

benjamine commented 6 years ago

@popojargo I struggled a bit with rollup, and ended up making a different change, used paths to alias to an empty module to avoid the additional dependency, here's the commit if you want to check it out: https://github.com/benjamine/jsondiffpatch/commit/c7ab56562f63be13a8ba4c6f767808b9aeaf0956 thanks for putting this together, and using create-react-app helped a lot in troubleshooting 👍 , published the fixed version as v0.3.10