Buckets:
| const path = require('node:path') | |
| const loader = async function (content) { | |
| this.async() | |
| if (!this.resourcePath.endsWith('file-to-transform.ts')) { | |
| return this.callback(null, content) | |
| } | |
| const dependencyFile = './file-dependency.ts' | |
| const context = path.dirname(this.resourcePath) | |
| const resolve = this.getResolve({}) | |
| const result = await resolve(context, dependencyFile) | |
| this.addDependency(result) | |
| this.callback( | |
| null, | |
| `export const utilFn = () => 'Generated at ${new Date().toISOString()}';` | |
| ) | |
| } | |
| module.exports = loader | |
Xet Storage Details
- Size:
- 557 Bytes
- Xet hash:
- e59512ecf4483963f962cfc9e8949364c38e8bd29ba1794f1643413329c515c4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.