Skip to content

Use an ESM-friendly UMD wrapper #30

@fuweichin

Description

@fuweichin

Overview
The UMD wrapper js-untar currently in use may cause an error in certain circumstances.

Steps to Reproduce:

<script type="module">
import '/node_modules/jquery/dist/jquery.min.js';/* global jQuery */
import '/node_modules/pako/dist/pako_inflate.min.js';/* global pako */
import '/node_modules/js-untar/build/dist/untar.js';/* global untar */ 
//...
</script>

jquery and pako are okay with native ESM loader, while js-untar will throw an error

TypeError: Cannot set property 'untar' of undefined

Possible Solution:
Use a more versatile variant of UMD, e.g. returnExportsGlobal.js

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