mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
add recursive require.undef for sdk
This commit is contained in:
parent
a7dc2d7496
commit
e5de2372c3
14
node_modules/architect-build/build_support/mini_require.js
generated
vendored
14
node_modules/architect-build/build_support/mini_require.js
generated
vendored
@ -282,7 +282,13 @@ config.packages = Object.create(null);
|
||||
config.paths = Object.create(null);
|
||||
config.baseUrl = "";
|
||||
|
||||
require.undef = function(module, callback) {
|
||||
require.undef = function(module, recursive) {
|
||||
if (recursive) {
|
||||
var root = (module + "/").replace("//", "/");
|
||||
$undefAll(root, define.errors);
|
||||
$undefAll(root, define.loaded);
|
||||
$undefAll(root, define.modules);
|
||||
}
|
||||
module = normalizeName("", module);
|
||||
var path = require.toUrl(module, ".js");
|
||||
delete define.errors[module];
|
||||
@ -291,6 +297,12 @@ require.undef = function(module, callback) {
|
||||
delete define.fetchedUrls[path];
|
||||
};
|
||||
|
||||
function $undefAll(module, hash) {
|
||||
for (var i in hash)
|
||||
if (i.lastIndexOf(module, 0) == 0)
|
||||
require.undef(i);
|
||||
}
|
||||
|
||||
require.MODULE_LOAD_URL = MODULE_LOAD_URL;
|
||||
|
||||
require.toUrl = function(moduleName, ext, skipExt) {
|
||||
|
||||
@ -239,7 +239,7 @@ define(function(require, exports, module) {
|
||||
paths[config.packagePath] = config.staticPrefix;
|
||||
|
||||
requirejs.config({ paths: paths });
|
||||
requirejs.undef([config.packagePath, "__installed__.js"].join("/"));
|
||||
requirejs.undef(config.packagePath, true);
|
||||
|
||||
require([[config.packagePath, "__installed__"].join("/")], function(installed) {
|
||||
callback(null, installed);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user