Created
July 14, 2023 22:28
-
-
Save 0187773933/79d5614d0f4f8bcf4bb760c4fb97eca2 to your computer and use it in GitHub Desktop.
Web Pack Get Chunk By ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( ()=> { | |
function get_chunk( chunk_id ) { | |
for ( let chunk_key in window.webpackChunk ) { | |
if ( window.webpackChunk[ chunk_key ][ 1 ].hasOwnProperty( chunk_id ) ) { | |
return window.webpackChunk[ chunk_key ][ 1 ][ chunk_id ]; | |
} | |
} | |
} | |
let chunk = get_chunk( 640151 ); | |
console.log( chunk ); | |
chunk(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment