Comments (5)
Add externals to esbuild CLI:
https://github.com/weiran-zsd/eslint-plugin-node/blob/26448e08477ef1d6b55f304609bf038a0a970a3f/scripts/convert-pure-esm-to-cjs.js#L4
from eslint-plugin-n.
For example, the bundled NPM packages builtins
, semver
, and yallist
are all CJS, not ESM:
https://unpkg.com/browse/builtins/
https://unpkg.com/browse/semver/
https://unpkg.com/browse/yallist/
... so they should be externalised from the esbuild bundle, which otherwise is a huge payload of hard-to-review (and trust) code shipped to developers / users of the esling-plugin-node
fork.
from eslint-plugin-n.
ping @aladdin-add @voxpelli @giltayar
๐
Thanks for your work ๐ธ
from eslint-plugin-n.
From 109KB
down to 32KB
, just by externalising CJS NPM packages builtins
yallist
and semver
:
npx esbuild --platform=node --external:builtins --external:yallist --external:semver --bundle node_modules/import-meta-resolve/lib/resolve.js > lib/converted-esm/import-meta-resolve.js
=>
from eslint-plugin-n.
Pull Request: #10
from eslint-plugin-n.
Related Issues (20)
- [file-extension-in-import] Does not work properly in TypeScript projects with allowImportingTsExtensions HOT 3
- [file-extension-in-import] Dir imports resolve to `package/dir.js` instead of `package/dir/index.js` HOT 4
- [file-extension-in-import] Does not work with node version 16.0.0 - 16.16.0 HOT 2
- :broom: Remove deprecated rules HOT 6
- ๐งน ESLint v9 deprecations HOT 1
- ๐ Basic TypeScript types HOT 4
- Bug: Update context methods to source code methods HOT 2
- Bug: no-extraneous-import doesn't support import maps HOT 4
- Dependency Dashboard
- Bug: `n/no-restricted-require` does not work for relative imports (as opposed to `no-restricted-modules` from ESLint)
- Bug: The readme says this supports ESLint >=7.0.0, but ruleContext.physicalFilename doesn't exist in version 7.15.0 on my machine HOT 2
- v17 planned changes HOT 9
- Change Request: remove Nullish Coalescing Assignment Operator HOT 1
- Bug: `no-callback-literal` HOT 2
- New Rule: restricted use globals var `__dirname` `__filename` in esm mode HOT 4
- add docs migrating from eslint-plugin-node HOT 1
- Bug: `import-target` mutes resolution errors
- Bug: n/no-missing-imports doesn't work correctly for workspace modules HOT 2
- Change Request: Migrate to release please manifest releaser
- Old releases support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-n.