Files
Jimmy Miller afb0dbac6a Adds .resolve to loaders api (#98361)
This fully fixes handlebars loader in my tests and a number of other
loaders depend on this as well. The implementation for getResolve is a
bit different in turbopack, but this should be semantically the same.
2026-09-08 13:02:16 -07:00

11 lines
284 B
JavaScript

const path = require('path')
module.exports = function () {
const callback = this.async()
this.resolve(this.context, './resolved-value.js', (err, result) => {
if (err) return callback(err)
callback(null, `export default ${JSON.stringify(path.basename(result))}`)
})
}