MyCrypto/webpack_config/plugins/serverLog.js

20 lines
428 B
JavaScript
Raw Normal View History

2017-07-04 03:28:56 +00:00
'use strict';
const chalk = require('chalk');
const LogPlugin = function(port) {
this.port = port;
this.protocol = process.env.HTTPS ? 'https' : 'http';
};
LogPlugin.prototype.apply = function(compiler) {
compiler.plugin('done', (compiler, done) => {
console.log(
`> App is running at ${chalk.yellow(
`${this.protocol}://localhost:${this.port}`
)}\n`
);
});
2017-07-04 03:28:56 +00:00
};
module.exports = LogPlugin;