Browserified bundles use function named require
causing false missing import reports.
#139
Labels
enhancement
New feature or request
From #116 (comment), it looks like
browserify
will bundle code that uses the actual function namerequire
to import the code in the bundle and is not meant to be the actual Node.jsrequire
. This is as opposed to webpack, which has the unambiguous__webpack_require__()
function for the same thing.So this creates a lot of false missing files. In the
sanitize-html
case, there's lodash and other deps bundled in that then run afoul withrequire()
s of code that's actually in the bundle. See, e.g., https://unpkg.com/[email protected]/dist/sanitize-html.jsExample
Looking at the source in https://unpkg.com/[email protected]/dist/sanitize-html.js we have:
... and it does look like that that is the real lodash apply code within
sanitize-html
bundle that you'd normally find here: https://unpkg.com/[email protected]/_apply.js. SMy guess is that all of the four dependencies specified at https://github.com/apostrophecms/sanitize-html/blob/main/package.json#L29-L32 are actually included in that browserified bundle and you should be fine. Upon spot checking, lodash and postcss appear.
Task
The text was updated successfully, but these errors were encountered: