Coder Social home page Coder Social logo

Support esm about node-deep-equal HOT 7 CLOSED

Harpush avatar Harpush commented on August 20, 2024
Support esm

from node-deep-equal.

Comments (7)

ljharb avatar ljharb commented on August 20, 2024 2

It's not actually a best practice, it doesn't solve any problems (although it creates many), and only a very very small number of package authors are inflicting that on the ecosystem right now.

If you're having a specific problem, please file an issue about that; the format of the package should be none of your concern.

from node-deep-equal.

ljharb avatar ljharb commented on August 20, 2024 1

We already do, because ESM can import CJS.

from node-deep-equal.

ljharb avatar ljharb commented on August 20, 2024 1

No, the usual way is to do nothing, since CJS Just Works.

Adding a build step and the dual package hazard isn’t an improvement - CJS is the true universal format.

from node-deep-equal.

Harpush avatar Harpush commented on August 20, 2024

We already do, because ESM can import CJS.

I meant in the package json. Currently in angular I get commonjs optimization bailouts warning. I guess providing the mapping in package json can fix that

from node-deep-equal.

ljharb avatar ljharb commented on August 20, 2024

Those warnings are incorrect; any purely CJS package is importable from ESM with zero problems. If a bundler is having trouble doing that most basic thing, it's broken, and you should file an issue on it.

from node-deep-equal.

Harpush avatar Harpush commented on August 20, 2024

It works just shows a warning. Afaik the usual way is targeting both cjs and mjs using package json exports. Mostly you write esm and compile to cjs too. Is it not possible?

from node-deep-equal.

Harpush avatar Harpush commented on August 20, 2024

As far as I know there is the "move to esm" best practice lately. More and more packages support it

from node-deep-equal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.