mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 17:27:09 +00:00
Use classes for webpack plugins.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
let fs = require('fs');
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = WatchTimestampsPlugin;
|
||||
|
||||
function WatchTimestampsPlugin(patterns) {
|
||||
module.exports = class WatchTimestampsPlugin {
|
||||
constructor(patterns) {
|
||||
this.patterns = patterns;
|
||||
}
|
||||
|
||||
WatchTimestampsPlugin.prototype.apply = function (compiler) {
|
||||
apply(compiler) {
|
||||
compiler.plugin('watch-run', (watch, callback) => {
|
||||
let patterns = this.patterns;
|
||||
let timestamps = watch.fileTimestamps || watch.compiler.fileTimestamps;
|
||||
@@ -20,4 +19,5 @@ WatchTimestampsPlugin.prototype.apply = function (compiler) {
|
||||
});
|
||||
callback();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user