MyCrypto/webpack_config/log-plugin.js
William O'Beirne 5e66cccac5 Command for HTTPS dev server (#212)
* HTTPS dev command.

* Remove unused declaration.

* check-node-version for dev:https
2017-09-19 17:47:46 -07:00

21 lines
471 B
JavaScript

'use strict';
const chalk = require('chalk');
// this plugin if for loggin url after each time the compilation is done.
module.exports = class LogPlugin {
constructor(port) {
this.port = port;
}
apply(compiler) {
const protocol = process.env.HTTPS ? 'https' : 'http';
compiler.plugin('done', () => {
console.log(
`> App is running at ${chalk.yellow(
`${protocol}://localhost:${this.port}`
)}\n`
);
});
}
};