postinstall-js
v0.9.3
Published
postinstall command to compile and minify javascript files
Downloads
162
Maintainers
Readme
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.