Currently, I am in the process of converting enhanced-resolve to TypeScript.
Exploring the New Version
The majority of the work has been completed.
However, I have encountered a challenge due to the outdated structure of enhanced-resolve. Defining the entry module is proving difficult.
How can I convert the following code snippet into a TypeScript definition (with irrelevant parts removed)?
// Key point here: export assignment
module.exports = function resolve(context, path, request, callback) {
};
module.exports.sync = function resolveSync(context, path, request){
};
// Another key point: nested export within a function
module.exports.loader = function resolveLoader(context, path, request, callback) {
};
module.exports.loader.sync = function resolveLoaderSync(context, path, request) {
};
Note: November 5th, 2016
Take a look at the partially transformed code. The only aspect I'm struggling with is the exporting mechanism. It's essential for compatibility with webpack to utilize export assignments.
I'm curious if there is a solution to this dilemma or if modifying the library's export signature is necessary?