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

cjs version scribe@4.0.0 does not work with browserify w/ deamdify #514

@simonfan

Description

@simonfan

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions