New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-node-externals

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-node-externals - npm Package Compare versions

Comparing version

to
1.0.1

dist/index.mjs

6

CHANGELOG.md
# CHANGELOG
## Developing 1.0.0(2022-11-16)
## Released 1.0.1
- BugFix: Update build configuration for better CJS & ESM compat support.
## Released 1.0.0
- No significant changes.
- CHORE: Both CJS and ESM output will be published now, as with `exports` field in packages.json, you will be using the ESM version by `import`, and CJS version by `require`.

17

package.json
{
"name": "esbuild-plugin-node-externals",
"version": "1.0.0",
"version": "1.0.1",
"description": "ESBuild plugin for node externals.",

@@ -24,4 +24,4 @@ "keywords": [

".": {
"import": "./dist/esm/index.js",
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"

@@ -37,12 +37,7 @@ }

},
"tsup": {
"entry": "src/index.ts",
"splitting": false,
"sourcemap": false,
"clean": true
"scripts": {
"dev": "tsup src/index.ts --watch --dts --format esm",
"build": "rm -rf dist && tsup src/index.ts --config ../../tsup.config.ts"
},
"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"
}
"readme": "# esbuild-plugin-node-externals\n\nESBuild plugin for node externals handing.\n\n- [Author](https://github.com/linbudu599)\n- [GitHub Repo](https://github.com/LinbuduLab/esbuild-plugins/tree/master/packages/esbuild-plugin-node-externals#readme)\n- [Changelog](https://github.com/LinbuduLab/esbuild-plugins/blob/main/packages/esbuild-plugin-node-externals/CHANGELOG.md)\n\n## Usage\n\n```bash\nnpm install esbuild-plugin-node-externals --save-dev\npnpm install esbuild-plugin-node-externals --save-dev\nyarn add esbuild-plugin-node-externals --save-dev\n```\n\n```typescript\nimport { build } from 'esbuild';\nimport { nodeExternals } from 'esbuild-plugin-node-externals';\n\n(async () => {\n const res = await build({\n entryPoints: ['.src/main.ts'],\n bundle: true,\n outfile: './dist/main.js',\n plugins: [\n nodeExternals({\n packagePaths: 'package.json',\n include: ['SOME_PKG_YOU_WANT_TO_INCLUDE_AT_BUNDLE'],\n }),\n ],\n });\n})();\n```\n\n## Configurations\n\n```typescript\nexport interface NodeExternalsOptions {\n /**\n * list of package.json paths to read from\n * if not specified, will read from cwd\n */\n packagePaths: string | string[];\n\n /**\n * mark all dependencies as external\n * @default true\n */\n withDeps: boolean;\n\n /**\n * mark all devDependencies as external\n * @default true\n */\n withDevDeps: boolean;\n\n /**\n * mark all peerDependencies as external\n * @default true\n */\n withPeerDeps: boolean;\n\n /**\n * mark all optionalDependencies as external\n * @default true\n */\n withOptDeps: boolean;\n\n /**\n * list of packages to exclude from externalization\n */\n include: string[];\n}\n```\n"
}