MyCrypto/webpack_config/log-plugin.js

18 lines
385 B
JavaScript
Raw Normal View History

2017-07-04 03:28:56 +00:00
'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) {
2017-07-04 03:28:56 +00:00
this.port = port;
}
apply(compiler) {
compiler.plugin('done', () => {
2017-07-04 03:28:56 +00:00
console.log(
`> App is running at ${chalk.yellow(`http://localhost:${this.port}`)}\n`
);
});
}
2017-07-04 03:28:56 +00:00
};