Skip to content
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

Doesn't export /safe in package.json #350

Open
movahhedi opened this issue Jan 10, 2024 · 0 comments
Open

Doesn't export /safe in package.json #350

movahhedi opened this issue Jan 10, 2024 · 0 comments

Comments

@movahhedi
Copy link

movahhedi commented Jan 10, 2024

The package.json file doesn't provide the following props (the values are for example):

{
  "source": "src/index.js",             // input
  "main": "dist/foo.js",                // CommonJS output bundle
  "umd:main": "dist/foo.umd.js",        // UMD output bundle
  "module": "dist/foo.mjs",             // ES Modules output bundle
  "exports": {
    "types": "./dist/foo.d.ts",         // TypeScript typings for NodeNext modules
    "require": "./dist/foo.js",         // CommonJS output bundle
    "default": "./dist/foo.modern.mjs", // Modern ES Modules output bundle
  },
  "types": "dist/foo.d.ts"              // TypeScript typings
}

And more importantly, doesn't do so for /safe. so importing it like import Colors from "colors/safe"; produces an error in some node configured environments. you'd have to import it like import Colors from "colors/safe.js";.

Didn't have the time to make a tested PR, just noted it for it in case, as a technical debt.

Example is from microbundle's README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant