| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /opt/bitnami/apache/htdocs/app/node_modules/laravel-mix/src/ |
Upload File : |
let path = require('path');
let File = require('./File');
class HotReloading {
/**
*
* @param {import('./Mix')} mix
*/
constructor(mix) {
this.mix = mix;
}
record() {
this.clean();
if (!this.mix.config.hmr) {
return;
}
this.hotFile().write(
`${this.http()}://${this.mix.config.hmrOptions.host}:${this.port()}`
);
}
hotFile() {
return new File(path.join(this.mix.config.publicPath, 'hot'));
}
http() {
return process.argv.includes('--https') ? 'https' : 'http';
}
port() {
return process.argv.includes('--port')
? process.argv[process.argv.indexOf('--port') + 1]
: this.mix.config.hmrOptions.port;
}
clean() {
this.hotFile().delete();
}
/** @deprecated */
static record() {
return new HotReloading(global.Mix).record();
}
/** @deprecated */
static hotFile() {
return new HotReloading(global.Mix).hotFile();
}
/** @deprecated */
static http() {
return new HotReloading(global.Mix).http();
}
/** @deprecated */
static port() {
return new HotReloading(global.Mix).port();
}
/** @deprecated */
static clean() {
return new HotReloading(global.Mix).clean();
}
}
module.exports = HotReloading;