2017-07-03 20:28:56 -07:00
|
|
|
'use strict';
|
|
|
|
const chalk = require('chalk');
|
2017-04-11 21:59:58 -07:00
|
|
|
|
|
|
|
// this plugin if for loggin url after each time the compilation is done.
|
|
|
|
module.exports = class LogPlugin {
|
|
|
|
constructor(port) {
|
2017-07-03 20:28:56 -07:00
|
|
|
this.port = port;
|
2017-04-11 21:59:58 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
apply(compiler) {
|
|
|
|
compiler.plugin('done', () => {
|
2017-07-03 20:28:56 -07:00
|
|
|
console.log(
|
|
|
|
`> App is running at ${chalk.yellow(`http://localhost:${this.port}`)}\n`
|
|
|
|
);
|
|
|
|
});
|
2017-04-11 21:59:58 -07:00
|
|
|
}
|
2017-07-03 20:28:56 -07:00
|
|
|
};
|