mirror of https://github.com/webpack/webpack.git
Compare commits
3 Commits
5521c3a24a
...
730f80c7c1
Author | SHA1 | Date |
---|---|---|
|
730f80c7c1 | |
|
5c11f27b6b | |
|
fad1bc1f32 |
|
@ -376,7 +376,9 @@ class LazyCompilationPlugin {
|
|||
apply(compiler) {
|
||||
/** @type {BackendApi} */
|
||||
let backend;
|
||||
compiler.hooks.beforeCompile.tapAsync(PLUGIN_NAME, (params, callback) => {
|
||||
compiler.hooks.beforeCompile.tapAsync(
|
||||
PLUGIN_NAME,
|
||||
(/** @type {any} */ params, /** @type {(err?: Error | null) => void} */ callback) => {
|
||||
if (backend !== undefined) return callback();
|
||||
const promise = this.backend(compiler, (err, result) => {
|
||||
if (err) return callback(err);
|
||||
|
@ -389,15 +391,25 @@ class LazyCompilationPlugin {
|
|||
callback();
|
||||
}, callback);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
compiler.hooks.thisCompilation.tap(
|
||||
PLUGIN_NAME,
|
||||
/**
|
||||
* @param {import("../Compilation")} compilation
|
||||
* @param {{ normalModuleFactory: import("../NormalModuleFactory") }} param1
|
||||
*/
|
||||
(compilation, { normalModuleFactory }) => {
|
||||
normalModuleFactory.hooks.module.tap(
|
||||
PLUGIN_NAME,
|
||||
/**
|
||||
* @param {Module} module
|
||||
* @param {*} createData
|
||||
* @param {*} resolveData
|
||||
*/
|
||||
(module, createData, resolveData) => {
|
||||
if (
|
||||
resolveData.dependencies.every((dep) =>
|
||||
resolveData.dependencies.every((dep: any) =>
|
||||
HMR_DEPENDENCY_TYPES.has(dep.type)
|
||||
)
|
||||
) {
|
||||
|
@ -457,7 +469,7 @@ class LazyCompilationPlugin {
|
|||
);
|
||||
}
|
||||
);
|
||||
compiler.hooks.shutdown.tapAsync(PLUGIN_NAME, (callback) => {
|
||||
compiler.hooks.shutdown.tapAsync(PLUGIN_NAME, (callback: (...args: any[]) => void) => {
|
||||
backend.dispose(callback);
|
||||
});
|
||||
}
|
||||
|
|
24
package.json
24
package.json
|
@ -111,16 +111,16 @@
|
|||
"@babel/core": "^7.27.1",
|
||||
"@babel/preset-react": "^7.27.1",
|
||||
"@codspeed/core": "^4.0.1",
|
||||
"@eslint/js": "^9.29.0",
|
||||
"@eslint/markdown": "^7.1.0",
|
||||
"@stylistic/eslint-plugin": "^5.2.2",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@eslint/markdown": "^7.3.0",
|
||||
"@stylistic/eslint-plugin": "^5.4.0",
|
||||
"@types/glob-to-regexp": "^0.4.4",
|
||||
"@types/graceful-fs": "^4.1.9",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/mime-types": "^2.1.4",
|
||||
"@types/node": "^24.1.0",
|
||||
"@types/node": "^24.5.2",
|
||||
"@types/xxhashjs": "^0.2.4",
|
||||
"assemblyscript": "^0.28.5",
|
||||
"assemblyscript": "^0.28.8",
|
||||
"babel-loader": "^10.0.0",
|
||||
"bundle-loader": "^0.5.6",
|
||||
"coffee-loader": "^5.0.0",
|
||||
|
@ -131,13 +131,13 @@
|
|||
"date-fns": "^4.0.0",
|
||||
"es5-ext": "^0.10.53",
|
||||
"es6-promise-polyfill": "^1.2.0",
|
||||
"eslint": "^9.29.0",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-config-prettier": "^10.1.1",
|
||||
"eslint-config-webpack": "^4.5.1",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-jsdoc": "^51.2.3",
|
||||
"eslint-plugin-n": "^17.21.0",
|
||||
"eslint-plugin-n": "^17.23.1",
|
||||
"eslint-plugin-prettier": "^5.5.0",
|
||||
"eslint-plugin-unicorn": "^61.0.1",
|
||||
"file-loader": "^6.0.0",
|
||||
|
@ -146,11 +146,11 @@
|
|||
"hash-wasm": "^4.9.0",
|
||||
"husky": "^9.0.11",
|
||||
"istanbul": "^0.4.5",
|
||||
"jest": "^30.1.2",
|
||||
"jest-circus": "^30.1.2",
|
||||
"jest-cli": "^30.1.2",
|
||||
"jest-diff": "^30.1.2",
|
||||
"jest-environment-node": "^30.1.2",
|
||||
"jest": "^30.2.0",
|
||||
"jest-circus": "^30.2.0",
|
||||
"jest-cli": "^30.2.0",
|
||||
"jest-diff": "^30.2.0",
|
||||
"jest-environment-node": "^30.2.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
"json-loader": "^0.5.7",
|
||||
"json5": "^2.1.3",
|
||||
|
|
Loading…
Reference in New Issue