();
+ namespaces.forEach(({ name, path }) => distinctNamespaces.set(name, convertSlashesInPath(path)));
+
+ const moduleRegisters: string[] = [];
+ distinctNamespaces.forEach((path, name) => {
+ moduleRegisters.push(`global.registerModule("${name}", function() { return require("${path}"); });\n`);
+ });
// escape special whitespace characters
// see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Issue_with_plain_JSON.stringify_for_use_as_JavaScript
@@ -99,16 +134,12 @@ module.exports = function (source, map) {
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029');
- const wrapped = `${moduleRegisters}\nmodule.exports = ${json}`;
+ const wrapped = `${moduleRegisters.join("")}\nmodule.exports = ${json}`;
- callback(null, wrapped, map);
+ callbackWrapper(null, wrapped, map);
}).catch((err) => {
- callback(err);
+ callbackWrapper(err);
})
-
}
-function convertPath(obj) {
- obj.path = convertSlashesInPath(obj.path);
- return obj;
-}
+export default loader;
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy