Flarum (v2.0.0)
    Preparing search index...

    Interface IChunkRegistryInternal

    interface IChunkRegistry {
        chunkModules: Map<string, Module>;
        chunks: Map<string, Chunk>;
        addChunkModule(
            chunkId: string | number,
            moduleId: string | number,
            namespace: string,
            urlPath: string,
        ): void;
        asyncModuleImport(path: string): Promise<any>;
        checkModule(namespace: string, id: string): any;
        getChunk(
            chunkId: string | number,
            namespace?: string,
            url?: string,
        ): Chunk | null;
        loadChunk(
            original: Function,
            url: string,
            done: () => Promise<void>,
            key: number,
            chunkId: string | number,
            namespace?: string,
        ): Promise<void>;
    }

    Implemented by

    Index

    Properties

    chunkModules: Map<string, Module>
    chunks: Map<string, Chunk>

    Methods

    • Register a module by the chunk ID it belongs to, the webpack module ID it belongs to, the namespace (extension ID), and its path.

      Parameters

      • chunkId: string | number
      • moduleId: string | number
      • namespace: string
      • urlPath: string

      Returns void

    • Get a registered chunk. Each chunk has at least one module (the default one).

      Chunk ids are only unique within one build, so pass the namespace of the build asking. Bundles built before flarum-webpack-config sent it can't, so without it the chunk is matched by its file name in url where ids collide, and is otherwise the first registered under the id.

      Parameters

      • chunkId: string | number
      • Optionalnamespace: string
      • Optionalurl: string

      Returns Chunk | null