marvinhagemeister / check-export-map Goto Github PK
View Code? Open in Web Editor NEWCheck if the export map declared in package.json is valid
License: MIT License
Check if the export map declared in package.json is valid
License: MIT License
the readme states:
Example of a valid export map
... but the inconsistent import / require is invalid, based on the latest heuristics:
If the package.json
contains "type": "module"
the export entry for type import
may have the .js
file extension.
Example:
{
"type": "module",
"exports": {
"./file": {
"import": "./some/file.js"
}
}
}
@marvinhagemeister
Is a PR for this welcome?
Allow Nested conditions in the check.
A lot of packages only use flat map for conditional exports, meaning in the era of ESM, we only have *.module.js
for browser
.
Example : Jest
It's not actually a very good idea to publish packages with a single entry-point despite it being commonplace.
WRONG:
{
"default": "./2.js",
"require": "./1.js"
}
RIGHT:
{
"require": "./1.js",
"default": "./2.js"
}
Next.js (and I assume, Webpack 5) errors if you don't get this right.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.