feat: webpack ctx hook
This commit is contained in:
parent
023f7bf215
commit
6bc841f132
|
@ -9,7 +9,7 @@ interface Module {
|
||||||
(module, exports, __webpack_require__): void;
|
(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 moduleLookup = (id: string, globalWebpackJson: WebpackJson) => {
|
||||||
const pack = globalWebpackJson.find(x => x[1][id])!
|
const pack = globalWebpackJson.find(x => x[1][id])!
|
||||||
|
@ -116,4 +116,10 @@ export const [webpackGlobalOverride, onPackLoad] = (() => {
|
||||||
] as const
|
] as const
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
export const webpackContext = new Promise<any>((resolve) => {
|
||||||
|
webpackGlobalOverride(ALL, (n, r, t) => {
|
||||||
|
resolve(t)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
export default webpackHook
|
export default webpackHook
|
||||||
|
|
Loading…
Reference in New Issue