Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

cjs version [email protected] does not work with browserify w/ deamdify #514

Open
simonfan opened this issue Oct 18, 2017 · 0 comments
Open

Comments

@simonfan
Copy link

The polyfill introduced at #496 (polyfill for lodash-amd/modern/string/escape) breaks compatibility with the cjs browserify w/ deamdify build process.

The problem seems to be that the polyfilled module (defined at src/plugins/core/formatters/plain-text/escape-html-characters.js) has multiple AMD module definitions in one single file which breaks the way deamdify works (by taking the first anonymous module defined in the file and transforming it into a cjs module).

A simple solution would be to flatten the module dependencies in this file and put all functions into a single module. Here is my basic implementation that got it working.

Maybe I am missing some other parts of the code that depend on these modules, but running a simple search through the source code I could not find any code depending explicitly on either lodash or the submodules defined on the polyfill's file lodash-amd/modern/internal/baseToString, lodash-amd/modern/internal/escapeHtmlChar, lodash-amd/modern/string/escape or lodash-amd/modern/string/escape. It seems that those are only internal dependencies of the submodule.

I would love to help to get this working and would like to hear your opinion on this :)

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

No branches or pull requests

1 participant