Buckets:
| const fs = require('fs') | |
| const path = require('path') | |
| // A simple webpack loader that logs when an entry is being processed | |
| module.exports = function entryLoggerLoader(source) { | |
| const callback = this.async() | |
| const resourcePath = this.resourcePath | |
| const logFile = path.join(__dirname, '.entry-log') | |
| console.log('loader', resourcePath) | |
| // Extract the page name from the resource path | |
| let pageName = resourcePath | |
| if (resourcePath.includes('/app/')) { | |
| pageName = resourcePath.split('/app/')[1] || resourcePath | |
| } else if (resourcePath.includes('/pages/')) { | |
| pageName = resourcePath.split('/pages/')[1] || resourcePath | |
| } | |
| // Log the entry processing with timestamp | |
| const logEntry = `${Date.now()}:${pageName}\n` | |
| fs.appendFile(logFile, logEntry, (err) => { | |
| if (err) { | |
| console.error('Failed to write entry log:', err) | |
| } | |
| callback(null, source) | |
| }) | |
| } | |
Xet Storage Details
- Size:
- 896 Bytes
- Xet hash:
- 305bc69e1e9bcb39e01547a6d4376f9748128a01559ce312b90a504949a94abc
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.