postinstall command to compile and minify javascript files
npm install postinstall-jsThis 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.
The plugin can be called directly, or through postinstall.
Directly:
``js`
require('postinstall-js')(inputs, output, options).then(function() {
// done
});
A Browserslist query string
Pass minify: false to disable minification.
By default, when minify is active, babel comments option is set to false.
By default modules: false is passed to babel-preset-env.
A path to a cache directory must be set to enable cache.
Note that babel 7 and @babel/plugin-transform-classes only support this
type of constructor overriding:
`js``
class HTMLMyCustomElement extends HTMLElement {
constructor(me) {
me = super(me);
me.init();
return me;
}
init() {}
}
Support for source maps is not available and will be added eventually.