feat: webpack ctx hook

This commit is contained in:
Xmader 2020-11-17 12:09:23 -05:00
parent 023f7bf215
commit 6bc841f132
No known key found for this signature in database
GPG Key ID: A20B97FB9EB730E4
1 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,7 @@ interface Module {
(module, exports, __webpack_require__): void;
}
type WebpackJson = [number[], { [id: string]: Module }][]
type WebpackJson = [number[], { [id: string]: Module }, any[]?][]
const moduleLookup = (id: string, globalWebpackJson: WebpackJson) => {
const pack = globalWebpackJson.find(x => x[1][id])!
@ -116,4 +116,10 @@ export const [webpackGlobalOverride, onPackLoad] = (() => {
] as const
})()
export const webpackContext = new Promise<any>((resolve) => {
webpackGlobalOverride(ALL, (n, r, t) => {
resolve(t)
})
})
export default webpackHook