Socket
Socket
Sign inDemoInstall

@db-scripts/bundle

Package Overview
Dependencies
553
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @db-scripts/bundle

Bundling for my OS projects


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
52.1 MB
Created
Weekly downloads
 

Readme

Source

@db-scripts/bundle

Installation

npm i -D @db-scripts/bundle

Usage

Add this to your package.json

{
  "scripts": {
    "build": "db-scripts-bundle --size-snapshot",
  }
}

This will create an ES Module build, a commonjs build, a umd build and an esnext build within a dist folder.

It also will also add a .size-snapshot.json which will tell you the size of your library including all required dependencies.

Typically you want to add these fields to your package.json

{
  "main": "dist/cjs/index.js",
  "module": "dist/es/index.js",
  "sideEffects": false,
  "files": [
    "dist"
  ],
}

Check out the docs for sideEffects to make sure you understand what this field implies.

The bundling process uses plain babel for the esm and commonjs builds. You can find the reasoning here.

Thanks

The scripts are very heavily inspired by kcd-scripts. Thanks a lot for sharing your code Kent!

Keywords

FAQs

Last updated on 18 Sep 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc