Open mmomtchev opened 10 months ago
Are you interested in maintaining a Node.js CJS version? In this case quick-lru
must be bundled in the dist file, rollup is capable of doing it - currently the CJS is produced by tsc
which does not have this capability.
If I spend a day fixing this, would you be interested in merging the PR?
Are you interested in maintaining a Node.js CJS version? In this case
quick-lru
must be bundled in the dist file, rollup is capable of doing it - currently the CJS is produced bytsc
which does not have this capability.If I spend a day fixing this, would you be interested in merging the PR?
hi there, i am facing the same problem - i cannot get this to run because of quick-lru (const quick_lru_1 = __importDefault(require("quick-lru"));)
did you make a pr? or a fork of a working version?
Thanks a lot for your help!
Hi- has there been any movement on this? I am using 2.1.2
and still having this issue
Here is the exports section of the
package.json
:First of all, the
require
version does not work anymore - it hasn't been working for some time - sincequick-lru
does not support CJS anymore. As it adds to the complexity, I suggest to remove it.Second, the correct form of
exports
would have been (https://webpack.js.org/guides/package-exports/, https://nodejs.org/api/packages.html#packages_package_entry_points):Currently, it is not well defined what to include when importing from an ES6-capable browser bundler such as
webpack
- is itimport
or is itbrowser
? Well,webpack
picksimport
- which pulls the Node.js web-worker.Then the browser bundle is a CJS (UMD?) bundle - which is correct as this is the
node_modules
official standard, but these days almost all browser packages use ES6 (look at OpenLayers). If you want to be perfect to a fault, you should include both:Anyway most bundlers do not like the CJS (which is in fact an UMD?) - as there is no way to identify its named exports until it is actually loaded. So they quietly switch to the Node.js
import
version.