aboutcode-org / aboutcode-org/scancode-toolkit

.mjs.map are JS mapfiles

未關閉
#3,951 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
2.6k
分支
791
平均合併
1 天 12 小時
30 天內合併 PR
5

描述

In this npm:
- https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.2.67.tgz

.. we fail to scan this (large, 5MB) map file:
- pdf.worker.mjs.map

We should treat it as a map file, and hence extract it content in map smaller files

.mjs and .cjs files are JavaScript as explained in https://stackoverflow.com/a/57492606/302521

>
> Node.js's original module system is CommonJs (which uses require and module.exports).
>
> Since Node.js was created, the ECMAScript module system (which uses import and export) has become standard and Node.js has added support for it.
>
> Node.js will treat .cjs files as CommonJS modules and .mjs files as ECMAScript modules. It will treat .js files as whatever the default module system for the project is (which is CommonJS unless package.json says "type": "module",).

See also:
- https://nodejs.org/docs/latest/api/modules.html
- https://nodejs.org/docs/latest/api/esm.html

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。