20 lines
428 B
JavaScript
Raw Normal View History

2017-07-03 22:28:56 -05: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-03 22:28:56 -05:00
};
module.exports = LogPlugin;