feat: webpack ctx hook
This commit is contained in:
parent
023f7bf215
commit
6bc841f132
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue