docs/node_modules/@docusaurus/utils/lib/index.js
/**
 * Generate unique chunk name given a module path.
 */
Generate unique chunk name given a module path.
Generate unique chunk name given a module path .
function genChunkName(modulePath, prefix, preferredName, shortId = process.env.NODE_ENV === 'production') {
    let chunkName = chunkNameCache.get(modulePath);
    if (!chunkName) {
        if (shortId) {
            chunkName = simpleHash(modulePath, 8);
        }
        else {
            let str = modulePath;
            if (preferredName) {
                const shortHash = simpleHash(modulePath, 3);
                str = `${preferredName}${shortHash}`;
            }
            const name = str === '/' ? 'index' : docuHash(str);
            chunkName = prefix ? `${prefix}---${name}` : name;
        }
        chunkNameCache.set(modulePath, chunkName);
    }
    return chunkName;
}
function genChunkName ( modulePath , prefix , preferredName , shortId = process . env . NODE_ENV === 'production' ) { let chunkName = chunkNameCache . get ( modulePath ) ; if ( ! chunkName ) { if ( shortId ) { chunkName = simpleHash ( modulePath , 8 ) ; } else { let str = modulePath ; if ( preferredName ) { const shortHash = simpleHash ( modulePath , 3 ) ; str = ` ${ preferredName } ${ shortHash } ` ; } const name = str === '/' ? 'index' : docuHash ( str ) ; chunkName = prefix ? ` ${ prefix } ${ name } ` : name ; } chunkNameCache . set ( modulePath , chunkName ) ; } return chunkName ; }
Generate unique chunk name given a module path.
Generate unique chunk name given a module path .