mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
afb0dbac6a
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.
11 lines
284 B
JavaScript
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))}`)
|
|
})
|
|
}
|