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.

Support for package.json exports

See original GitHub issue

Type of Issue

[ ] Bug Report
[x] Feature Request

Description

I would like to have control over what is public in my package and what isn’t. Package Exports gives us ability to define those. This should prevent library users of importing library internals.

Example of usage is here

{
  "exports": {
    "default": {
      "import": "./fesm2015/ngx-abcd.js",
      "require": "./bundles/ngx-abcd.umd.js"
    },
    "node": {
      "import": "./fesm2015/ngx-abcd.js",
      "require": "./bundles/ngx-abcd.umd.js"
    }
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
github-actions[bot]commented, Sep 28, 2021

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modules: Packages | Node.js v19.3.0 Documentation
The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, ...
Read more >
Package exports - webpack
The exports field in the package.json of a package allows to declare which module should be used when using module requests like import...
Read more >
Node.JS (New) Package.json Exports Field | by Thomas Juster
The exports field (or “export map”) provides a way to expose your package modules for different environments and JavaScript flavors WHILE ...
Read more >
Exports in package.json - DEV Community ‍ ‍
I'm a front-end developer and ship my code via npm-packages. ... I faced problems that led me to the usage of exports field...
Read more >
Feature: support new package.json exports field · Issue #670
It's probably best to support it before things break. Features: Export submodules with sub-path exports;; Specific exports for both CJS and ESM modules....
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