esbuild-plugin-node-externals
Advanced tools
Comparing version 0.3.0 to 1.0.0
{ | ||
"name": "esbuild-plugin-node-externals", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"description": "ESBuild plugin for node externals.", | ||
@@ -9,17 +9,21 @@ "keywords": [ | ||
], | ||
"homepage": "https://github.com/linbudu599/nx-plugins/tree/master/packages/esbuild-plugin-copy#readme", | ||
"homepage": "https://github.com/LinbuduLab/esbuild-plugins/tree/master/packages/esbuild-plugin-node-externals#readme", | ||
"changelog": "https://github.com/LinbuduLab/esbuild-plugins/blob/main/packages/esbuild-plugin-node-externals/CHANGELOG.md", | ||
"bugs": { | ||
"url": "https://github.com/linbudu599/nx-plugins/issues" | ||
"url": "https://github.com/LinbuduLab/esbuild-plugins/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/linbudu599/nx-plugins.git" | ||
"url": "git+https://github.com/LinbuduLab/esbuild-plugins.git" | ||
}, | ||
"license": "MIT", | ||
"author": "Linbudu <linbudu599@gmail.com> (https://github.com/linbudu599)", | ||
"main": "src/index.js", | ||
"typings": "src/index.d.ts", | ||
"publishConfig": { | ||
"main": "src/index.js", | ||
"typings": "src/index.d.ts" | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
@@ -31,6 +35,14 @@ "dependencies": { | ||
"peerDependencies": { | ||
"esbuild": "^0.14.0" | ||
"esbuild": ">= 0.14.0" | ||
}, | ||
"scripts": {}, | ||
"readme": "# esbuild-plugin-node-externals\n\nESBuild plugin for node externals handing.\n\n- [Documentation](https://nx-plugins.netlify.app/derived/esbuild.html#node-externals).\n- [GitHub Repo](https://github.com/LinbuduLab/nx-plugins)\n- [Author](https://github.com/linbudu599)\n" | ||
"tsup": { | ||
"entry": "src/index.ts", | ||
"splitting": false, | ||
"sourcemap": false, | ||
"clean": true | ||
}, | ||
"scripts": { | ||
"dev": "tsup src/index.ts --watch --dts --format esm --legacy-output", | ||
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --legacy-output" | ||
} | ||
} |
@@ -5,4 +5,72 @@ # esbuild-plugin-node-externals | ||
- [Documentation](https://nx-plugins.netlify.app/derived/esbuild.html#node-externals). | ||
- [GitHub Repo](https://github.com/LinbuduLab/nx-plugins) | ||
- [Author](https://github.com/linbudu599) | ||
- [GitHub Repo](https://github.com/LinbuduLab/esbuild-plugins/tree/master/packages/esbuild-plugin-node-externals#readme) | ||
- [Changelog](https://github.com/LinbuduLab/esbuild-plugins/blob/main/packages/esbuild-plugin-node-externals/CHANGELOG.md) | ||
## Usage | ||
```bash | ||
npm install esbuild-plugin-node-externals --save-dev | ||
pnpm install esbuild-plugin-node-externals --save-dev | ||
yarn add esbuild-plugin-node-externals --save-dev | ||
``` | ||
```typescript | ||
import { build } from 'esbuild'; | ||
import { nodeExternals } from 'esbuild-plugin-node-externals'; | ||
(async () => { | ||
const res = await build({ | ||
entryPoints: ['.src/main.ts'], | ||
bundle: true, | ||
outfile: './dist/main.js', | ||
plugins: [ | ||
nodeExternals({ | ||
packagePaths: 'package.json', | ||
include: ['SOME_PKG_YOU_WANT_TO_INCLUDE_AT_BUNDLE'], | ||
}), | ||
], | ||
}); | ||
})(); | ||
``` | ||
## Configurations | ||
```typescript | ||
export interface NodeExternalsOptions { | ||
/** | ||
* list of package.json paths to read from | ||
* if not specified, will read from cwd | ||
*/ | ||
packagePaths: string | string[]; | ||
/** | ||
* mark all dependencies as external | ||
* @default true | ||
*/ | ||
withDeps: boolean; | ||
/** | ||
* mark all devDependencies as external | ||
* @default true | ||
*/ | ||
withDevDeps: boolean; | ||
/** | ||
* mark all peerDependencies as external | ||
* @default true | ||
*/ | ||
withPeerDeps: boolean; | ||
/** | ||
* mark all optionalDependencies as external | ||
* @default true | ||
*/ | ||
withOptDeps: boolean; | ||
/** | ||
* list of packages to exclude from externalization | ||
*/ | ||
include: string[]; | ||
} | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14808
293
0
76
8