Created
November 23, 2019 00:46
-
-
Save nojvek/0a8dc90030cd65489dcaca9b329c9a87 to your computer and use it in GitHub Desktop.
webpackJsonp modules
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
moduleMap = {}; | |
for (const p of webpackJsonp) { | |
const modules = p[1]; | |
for (const [moduleName, moduleFn] of Object.entries(modules)) { | |
const moduleContent = moduleFn.toString(); | |
const nameParts = moduleName.split(`!`); | |
const moduleId = nameParts[nameParts.length - 1] + (nameParts.length > 1 ? `!` : ``); | |
if (!moduleMap[moduleId]) { | |
moduleMap[moduleId] = moduleContent | |
} else if (moduleMap[moduleId] !== moduleContent) { | |
console.log(`diff ${moduleId}`); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment