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

build-esm

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-esm

Compile an ES Module for release on npm

  • 3.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
128
decreased by-38.16%
Maintainers
1
Weekly downloads
 
Created
Source

build-esm

Build Status

Compile an ES Module for release on npm

Installing

Install it locally to your project by running:

yarn add --dev build-esm

Manual Deployment

Add build-esm as a build script to package.json:

{
  "name": "project",
  "scripts": {
    "build": "build-esm"
  }
}

Then, run:

yarn build

build-esm copies all files that would be published by npm publish or yarn publish (accounting for .npmignore and files in package.json) into the dist directory, compiling all JavaScript files (with the .js extension) using Babel. All of the standard ways of configuring Babel (through the babel key in package.json and .babelrc) apply.

The package can be published by running:

npm publish dist

Continuous Deployment

When publishing from a continuous integration service, build-esm can compile files in-place, allowing npm publish without arguments to work as desired.

To enable in-place compilation, add build-esm as a prepack script to package.json:

{
  "name": "project",
  "scripts": {
    "prepack": "build-esm"
  }
}

Note that prepack is only supported in npm version 5 and greater.

Here are some example deployment workflows:

  • Travis CI

Keywords

FAQs

Package last updated on 13 May 2018

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