@@ -9,7 +9,6 @@ import type { BaseSource } from "./base/source.ts";
99import type { BaseFilter } from "./base/filter.ts" ;
1010import type { BaseUi } from "./base/ui.ts" ;
1111import { isDenoCacheIssueError } from "./utils.ts" ;
12- import { mods } from "./_mods.js" ;
1312
1413import type { Denops } from "jsr:@denops/std@~7.4.0" ;
1514import * as op from "jsr:@denops/std@~7.4.0/option" ;
@@ -144,8 +143,7 @@ export class Loader {
144143
145144 const name = parse ( path ) . name ;
146145
147- const mod = ( mods as Record < string , unknown > ) [ toFileUrl ( path ) . href ] ??
148- await import ( toFileUrl ( path ) . href ) ;
146+ const mod = await import ( toFileUrl ( path ) . href ) ;
149147
150148 const typeExt = this . #exts[ type ] ;
151149 let add ;
@@ -190,46 +188,6 @@ export class Loader {
190188 }
191189}
192190
193- export async function initStaticImportPath ( denops : Denops ) {
194- // Generate _mods.ts
195- let mods : string [ ] = [ ] ;
196- const runtimepath = await op . runtimepath . getGlobal ( denops ) ;
197- for (
198- const glob of [
199- "denops/@ddc-filters/*.ts" ,
200- "denops/@ddc-sources/*.ts" ,
201- "denops/@ddc-uis/*.ts" ,
202- ]
203- ) {
204- mods = mods . concat (
205- await fn . globpath (
206- denops ,
207- runtimepath ,
208- glob ,
209- 1 ,
210- 1 ,
211- ) ,
212- ) ;
213- }
214-
215- const staticLines = [ ] ;
216- for ( const [ index , path ] of mods . entries ( ) ) {
217- staticLines . push (
218- `import * as mod${ index } from "${ toFileUrl ( path ) . href } "` ,
219- ) ;
220- }
221- staticLines . push ( "export const mods = {" ) ;
222- for ( const [ index , path ] of mods . entries ( ) ) {
223- staticLines . push ( ` "${ toFileUrl ( path ) . href } ":` ) ;
224- staticLines . push ( ` mod${ index } ,` ) ;
225- }
226- staticLines . push ( "};" ) ;
227- await Deno . writeTextFile (
228- await denops . call ( "ddc#denops#_mods" ) as string ,
229- staticLines . join ( "\n" ) ,
230- ) ;
231- }
232-
233191async function globpath (
234192 denops : Denops ,
235193 search : string ,
0 commit comments