/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/watchCases/context/loader-missing-dep/0/loader.js
20 строк
524 B
Alexander Akait
fix: handle watchpack existence-only timestamp entries (#20916)
06 май 2026, 18:18
Не верифицирован
06 май 2026, 18:18
cb824e5
Код
Авторство
О чём код?
const path = require("path"); const target = path.resolve(__dirname, "future.json"); /** @type {import("../../../../../").LoaderDefinition} */ module.exports = function () { this.addMissingDependency(target); const callback = this.async(); this.fs.stat(target, (err, stat) => { if (err && /** @type {NodeJS.ErrnoException} */ (err).code !== "ENOENT") { return callback(err); } callback( null, `module.exports = ${JSON.stringify({ exists: Boolean(stat), random: Math.random() })};` ); }); };