MCPcopy Create free account
hub / github.com/codesandbox/codesandbox-client / removeModule

Method removeModule

packages/sandpack-core/src/manager.ts:578–594  ·  view source on GitHub ↗
(module: Module)

Source from the content-addressed store, hash-verified

576 }
577
578 removeModule(module: Module) {
579 // File structure changed, reset resolver cache
580 this.resetResolverCache();
581
582 const existingModule = this.transpiledModules[module.path];
583
584 values(existingModule.tModules).forEach(m => {
585 m.dispose(this);
586 this.removeTranspiledModule(m);
587 });
588
589 delete this.transpiledModules[module.path];
590
591 triggerFileWatch(module.path, 'rename');
592
593 this.markHardReload();
594 }
595
596 moveModule(module: Module, newPath: string) {
597 this.removeModule(module);

Callers 3

ManagerClass · 0.95
moveModuleMethod · 0.95
updateDataMethod · 0.95

Calls 6

resetResolverCacheMethod · 0.95
markHardReloadMethod · 0.95
triggerFileWatchFunction · 0.85
forEachMethod · 0.65
disposeMethod · 0.65

Tested by

no test coverage detected