Remove debugging output, require needed libraries

This commit is contained in:
Philipp Dieter 2024-06-24 20:08:43 +02:00
parent 5c6398d480
commit 2917fe8c7d

View File

@ -1,26 +1,25 @@
const { glob } = require('glob') const _ = require('lodash');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require("path");
const { glob } = require('glob');
class WebpackForceReload { class WebpackForceReload {
constructor(options = {}) { constructor(options = {}) {
let that = this; let that = this;
this.options = options; this.options = options;
this.resolvedFiles = []; this.resolvedFiles = [];
console.debug(this.options);
glob.glob( glob.glob(
this.options.files, this.options.files,
{ {
cwd: this.options.cwd cwd: this.options.cwd
}, },
function(err, matches) { function(err, matches) {
console.debug(matches);
_.forEach(matches, function(value) { _.forEach(matches, function(value) {
var resolvedFile = path.resolve(value); var resolvedFile = path.resolve(value);
that.resolvedFiles.push(resolvedFile); that.resolvedFiles.push(resolvedFile);
} }
); );
}); });
console.debug(this.resolvedFiles);
} }
apply (compiler) { apply (compiler) {
compiler.hooks.compilation.tap('WebpackForceReload', (compilation) => { compiler.hooks.compilation.tap('WebpackForceReload', (compilation) => {