silverwolf-x/project / test /e2e /filesystem-cache /my-timestamp-loader.js
silverwolf-x's picture
download
raw
503 Bytes
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()}`)
}

Xet Storage Details

Size:
503 Bytes
·
Xet hash:
083b9c57d1adc05f984b423dc45627715a5052ef62902d2d060ed8c33fec20b7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.