Remove webpack watch unhook

This commit is contained in:
Cohee 2024-11-29 00:25:31 +02:00
parent afccb8517a
commit 768b3e48f7

View File

@ -1,4 +1,3 @@
import process from 'node:process';
import path from 'node:path';
import webpack from 'webpack';
import { publicLibConfig } from '../../webpack.config.js';
@ -8,16 +7,6 @@ export default function getWebpackServeMiddleware() {
const outputFile = publicLibConfig.output?.filename;
const compiler = webpack(publicLibConfig);
if (process.env.NODE_ENV === 'production' || process.platform === 'android') {
compiler.hooks.done.tap('serve', () => {
if (compiler.watching) {
compiler.watching.close(() => { });
}
compiler.watchFileSystem = null;
compiler.watchMode = false;
});
}
/**
* A very spartan recreation of webpack-dev-middleware.
* @param {import('express').Request} req Request object.