mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Improve naming of the feature: `Turbopack FileSystem Cache`
12 lines
503 B
JavaScript
12 lines
503 B
JavaScript
module.exports = async function myLoader(source) {
|
|
console.log(`Run my-timestamp-loader on ${this.resourcePath}`)
|
|
if (this._compiler && this._compiler.__extra_delay) {
|
|
if (!this._compilation.__extra_delay) {
|
|
this._compilation.__extra_delay = true
|
|
// Make webpack consider the build as large change which makes it filesystem cache it sooner
|
|
await new Promise((resolve) => setTimeout(resolve, 2000))
|
|
}
|
|
}
|
|
return source.replace(/Timestamp/g, `Timestamp = ${Date.now()}`)
|
|
}
|