-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The exports package.json
needs a new paint job
#396
Comments
Are you interested in maintaining a Node.js CJS version? In this case 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 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 |
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.The text was updated successfully, but these errors were encountered: