feat: refactoring project
This commit is contained in:
39
node_modules/webpack/lib/node/ReadFileCompileAsyncWasmPlugin.js
generated
vendored
39
node_modules/webpack/lib/node/ReadFileCompileAsyncWasmPlugin.js
generated
vendored
@@ -18,6 +18,7 @@ class ReadFileCompileAsyncWasmPlugin {
|
||||
this._type = type;
|
||||
this._import = useImport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the plugin
|
||||
* @param {Compiler} compiler the compiler instance
|
||||
@@ -89,26 +90,28 @@ class ReadFileCompileAsyncWasmPlugin {
|
||||
|
||||
compilation.hooks.runtimeRequirementInTree
|
||||
.for(RuntimeGlobals.instantiateWasm)
|
||||
.tap("ReadFileCompileAsyncWasmPlugin", (chunk, set) => {
|
||||
if (!isEnabledForChunk(chunk)) return;
|
||||
const chunkGraph = compilation.chunkGraph;
|
||||
if (
|
||||
!chunkGraph.hasModuleInGraph(
|
||||
.tap(
|
||||
"ReadFileCompileAsyncWasmPlugin",
|
||||
(chunk, set, { chunkGraph }) => {
|
||||
if (!isEnabledForChunk(chunk)) return;
|
||||
if (
|
||||
!chunkGraph.hasModuleInGraph(
|
||||
chunk,
|
||||
m => m.type === WEBASSEMBLY_MODULE_TYPE_ASYNC
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
set.add(RuntimeGlobals.publicPath);
|
||||
compilation.addRuntimeModule(
|
||||
chunk,
|
||||
m => m.type === WEBASSEMBLY_MODULE_TYPE_ASYNC
|
||||
)
|
||||
) {
|
||||
return;
|
||||
new AsyncWasmLoadingRuntimeModule({
|
||||
generateLoadBinaryCode,
|
||||
supportsStreaming: false
|
||||
})
|
||||
);
|
||||
}
|
||||
set.add(RuntimeGlobals.publicPath);
|
||||
compilation.addRuntimeModule(
|
||||
chunk,
|
||||
new AsyncWasmLoadingRuntimeModule({
|
||||
generateLoadBinaryCode,
|
||||
supportsStreaming: false
|
||||
})
|
||||
);
|
||||
});
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user