question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`main` field in `package.json`

See original GitHub issue

The browser field already pointed to meriyah.umd.js, shouldn’t main point to meriyah.cjs.js?

And browser might want use the minified version?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
fiskercommented, Oct 28, 2020

As I understand jsdelivr looks for browser

https://github.com/prettier/prettier/pull/8387#issuecomment-633232840

We can add unpkg field for unpkg

0reactions
3cpcommented, Feb 10, 2021

I agree using .cjs on main field can better support what ever nodejs versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the 'main' parameter in package.json?
The main field is a module ID that is the primary entry point to your program. That is, if your package is named...
Read more >
Main property in package.json defines package entry point
First, Node looks for a package.json file and checks if it contains a main property. It will be used to point a file...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
In a package's package.json file, two fields can define entry points for a package: "main" and "exports" . Both fields apply to ...
Read more >
The Basics of Package.json in Node.js and npm - NodeSource
The main property of a package.json is a direction to the entry point to the module that the package.json is describing. In a...
Read more >
Understand jsnext:main field in package.json : WEB-21827
There's informal jsnext:main field that can point to ES6 version of the package and it should be required instead of simple main when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found