Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kaizen/package-bundler

Package Overview
Dependencies
Maintainers
0
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kaizen/package-bundler

Bundles libraries

  • 2.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
13K
increased by51.48%
Maintainers
0
Weekly downloads
 
Created
Source

@kaizen/package-bundler

Bundle packages as CJS and ESM with TypeScript types.

ESM code is tree-shakeable.

pnpm add -D @kaizen/package-bundler

Presets

  • Default preset
  • Shared UI preset

Package entrypoints

Depending on the compatibility you wish to provide for your consumer, you may need to define your package.json differently. Read more about the different types of package.json entrypoints here.

Node 12+

If your consumers are all using Node 12+ (including using TypeScript moduleResolution node16/nodenext/bundler), you should be able to use the exports field if you have multiple entrypoints.

Node <=10

If your consumers may be using version 10 or lower (or are using TypeScript moduleResolution classic/node/node10), the exports field will not be resolved. Your only option will be to utilise main (resolves CJS), module (resolves ESM), and types (resolves TypeScript).

Should you want multiple entrypoints, you will need to create a directory relative from the root of the package and create a package.json within that contains the extra resolutions.

Eg. If we want to create an entrypoint at @kaizen/package-bundler/future:

Folder structure:

- future/
  - package.json
- src/...
- package.json

Contents for future/package.json (adjust your paths based on your defined dist structure).

{
  "main": "../dist/cjs/future.cjs",
  "module": "../dist/esm/future.mjs",
  "types": "../dist/types/__future__/index.d.ts"
}

You will also need to ensure that this directory is included in your distributed package, so in the main package.json, ensure the directory is included in files.

"files": [
  "dist",
  "future"
]

FAQs

Package last updated on 15 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc