webpack/lib/web/FetchCompileWasmTemplatePlu...

20 lines
653 B
JavaScript
Raw Normal View History

2017-10-30 20:56:57 +08:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const FetchCompileWasmMainTemplatePlugin = require("./FetchCompileWasmMainTemplatePlugin");
const WasmModuleTemplatePlugin = require("../wasm/WasmModuleTemplatePlugin");
2017-10-30 20:56:57 +08:00
class FetchCompileWasmTemplatePlugin {
apply(compiler) {
2017-12-06 22:01:25 +08:00
compiler.hooks.thisCompilation.tap("FetchCompileWasmTemplatePlugin", (compilation) => {
new FetchCompileWasmMainTemplatePlugin().apply(compilation.mainTemplate);
new WasmModuleTemplatePlugin().apply(compilation.moduleTemplates.javascript);
2017-10-30 20:56:57 +08:00
});
}
}
module.exports = FetchCompileWasmTemplatePlugin;