1.3.0 • Public • Published

ECMAScript 2049 Package

ECMAScript 2049


© Harald Rudell created ECMAScript 2049 in December 2017. ISC License

This is the es2049package package

Repository links:
ECMAScript 2049 the monolithic repository
es2049scripts providing build-scripts written in ES.Next
allspawn async/promise command execution


es2049package allows a library or command-line utility to be compiled with only one installed dependency and no configuration files.


  1. Add es2049package to your project

    yarn add es2049package --dev
  2. Add build to the scripts entry of package.json:

    "scripts": {
     "build": "rollup --config node:es2049package"
  3. Build:

    yarn build


  • If building a Node.js library, consider newer than default rollup.targets: 6.10, like "targets": {"node": 8}. Ensure proper main, module are set in package.json
  • If writing a command-line executable set rollup.shebang: true and if self-contained "dependencies": false. Possibly use "targets": "mini"
  • It does work, here is a functional package.json
  • If it seems mysterious, use ES2049PACKAGE_DEBUG and possibly ES2049PACKAGE_RESOLVE or ES2049PACKAGE_LOAD as described below

A package.json using es2049package can be found here

Fields in package.json

Fields used are the rollup key as well as standard top-level keys name, main, module

Rollup keys:

  • input: optional string or array, default src/index.js or src/index.mjs: the entry point used for compilation. If this is an array, it is of objects each describing a compilation with keys: input output dependencies main module external node print shebang targets eslint. Those keys overrides the rollup keys.
    • main: boolean, default false. use main field as output
    • module: boolean, default false. use module field as output
  • output: optional array or object. A rollup object with file and format (cjs, es) properties. default is according to main or module (or both), if none present it is './build/<package-name>', used for command-line executables
  • external: optional string, array of string: list of packages or filenames that are to be external
  • clean: string or list of strings, desribed below under clean command
  • node: boolean default true. If true, the standard library are added as externals. Should normally be used for all Node.js programs
  • targets: optional string
    • "stable" Node.js 4.8.1 LTS maintenance
    • "current" The currently executing Node.js
    • a target object as defined by babelJS
    • "mini" indicates Node.js 9+
    Default is Node.js 6.10 LTS active.
  • dependencies: optional boolean default true whether dependencies in package.json should be external. Use false if building a self-contained executable.
  • shebang: boolean, default false. If true: the output is an executable, with a shebang line and proper permissions.
  • eslint: boolean, default true if ./.eslintrc.json and ./.eslintrc.yaml are missing. If true: A default eslint configuration based on babel-eslint is provided.

clean command

Intended to provide a clean command for use with yarn. Clean, when invoked using yarn clean, removes any files or directories provided to it as command-line arguments or if no argments from the rollup.clean field of package.json

"rollup": {
 "clean": "bin"


"scripts": {
 "clean": "clean lib bin"

rollup command

The ability to use Rollup although it is a transitive dependency.


To develop or compile the ECMAScript 2049 project Yarn 1+ and Node.js current (v8.5+) are required.


Using environment variables, diagnostic printouts can be reviewed. On Linux, this is like:
ES2049PACKAGE_DEBUG=1 $(yarn bin)/rollup --config node:es2049package which prints configuration data and filenames processed by Babel.
Additionally, ES2049PACKAGE_RESOLVE prints all resolved import statements, thousands of lines.
ES2049PACKAGE_LOAD prints all files included in the bundle, also in the thousands.

As of February 2018, eslint has a problem in that configuration extends statements in eslint configuration files are resolved by the eslint path, not the eslint.rc path. Impact is that if es2049package, that holds eslint, is symlinked from an out-of-project-tree location, the extends file may not be found. eslint #9904

© Harald Rudell created ECMAScript 2049 in December 2017. ISC License


npm i es2049package

DownloadsWeekly Downloads






Unpacked Size

112 kB

Total Files


Last publish


  • haraldrudell