internetarchive / dweb-archivecontroller

GNU Affero General Public License v3.0
7 stars 2 forks source link

Compatability with ES6 Modules #2

Open mitra42 opened 4 years ago

mitra42 commented 4 years ago

Context The current repo is used by dweb-mirror via Node, and dweb-archive via webpack. Both of these are happy with "require"

However, Jason wants to use it with ES6 Modules, and that only works with import

Proposal and Constraints Change all require's for import and fix any problems that arise

Success Metrics If Jason can import dweb-archivecontroller/ArchiveItem, ArchiveFile, ArchiveMember into his Lit based web components. AND We can still successfully include it by running webpack --mode production in dweb-archive repo, AND successfully include it by running "internetarchive -sc" i.e. this solution should include PR's in both those repo's if required.

Stakeholders @jbuckner @mitra42

Resources and Links https://timonweb.com/tutorials/how-to-enable-ecmascript-6-imports-in-nodejs/ describes how to use esm to run import in Node

mitra42 commented 4 years ago

Suggested pathway - feel free to edit this comment...