postinstall-js

0.9.3 • Public • Published

postinstall-js

This is a postinstall command plugin.

It runs babel-preset-env and babel-preset-minify on inputs, and concatenate them on output.

To transform inputs using browserify, please check postinstall-browserify.

Usage

The plugin can be called directly, or through postinstall.

Directly:

require('postinstall-js')(inputs, output, options).then(function() {
 // done
});

Options

browsers

A Browserslist query string

minify

Pass minify: false to disable minification.

comments

By default, when minify is active, babel comments option is set to false.

modules

By default modules: false is passed to babel-preset-env.

cacheDir

A path to a cache directory must be set to enable cache.

extending native elements

Note that babel 7 and @babel/plugin-transform-classes only support this type of constructor overriding:

class HTMLMyCustomElement extends HTMLElement {
 constructor(me) {
  me = super(me);
  me.init();
  return me;
 }
 init() {}
}

Caveats

Support for source maps is not available and will be added eventually.

Dependencies (5)

Dev Dependencies (1)

Package Sidebar

Install

npm i postinstall-js

Weekly Downloads

33

Version

0.9.3

License

MIT

Unpacked Size

4.55 kB

Total Files

5

Last publish

Collaborators

  • kapouer