Skip to content

Commit 8972480

Browse files
committed
Remove ES6 syntax
1 parent d5c63d8 commit 8972480

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jshint node:true */
2-
const { statSync } = require('fs');
2+
var statSync = require('fs').statSync;
33
var lr = require('tiny-lr');
44
var servers = {};
55

@@ -54,35 +54,35 @@ LiveReloadPlugin.prototype.start = function start(watching, cb) {
5454
};
5555

5656
LiveReloadPlugin.prototype.done = function done(stats) {
57-
this.changedFiles = Object.keys(stats.compilation.fileTimestamps).filter(watchfile => {
57+
this.changedFiles = Object.keys(stats.compilation.fileTimestamps).filter(function(watchfile) {
5858
return this.startTime < Math.ceil(statSync(watchfile).mtime);
59-
});
59+
}.bind(this));
6060

6161
this.startTime = Date.now();
6262

63-
const { assets } = stats.compilation;
63+
var assets = stats.compilation.assets;
6464
const include = [];
6565

66-
this.changedFiles.forEach(changedFile => {
67-
Object.keys(assets).forEach(assetName => {
66+
this.changedFiles.forEach(function(changedFile) {
67+
Object.keys(assets).forEach(function(assetName) {
6868
const asset = Object.assign({}, assets[assetName]);
6969
const sources = [];
7070

7171
if (asset.emitted && asset.existsAt.split('.').slice(-1)[0] !== 'css') {
7272
include.push(assetName);
7373
}
7474

75-
(asset.children || []).forEach(child => {
75+
(asset.children || []).forEach(function(child) {
7676
if (child && child._sourceMap && child._sourceMap.sources) {
77-
sources.push(...child._sourceMap.sources);
77+
sources.push.apply(sources, child._sourceMap.sources);
7878
}
7979
});
8080

8181
if (sources.includes(changedFile)) {
8282
include.push(assetName);
8383
}
84-
});
85-
});
84+
}, this);
85+
}, this);
8686

8787
var modules = stats.compilation.modules.find(child => child.reason);
8888
var hash = stats.compilation.hash;

0 commit comments

Comments
 (0)