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");
|
2017-12-14 08:21:44 +08:00
|
|
|
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) => {
|
2017-10-30 20:56:57 +08:00
|
|
|
compilation.mainTemplate.apply(new FetchCompileWasmMainTemplatePlugin());
|
2017-12-14 08:21:44 +08:00
|
|
|
compilation.moduleTemplates.javascript.apply(new WasmModuleTemplatePlugin());
|
2017-10-30 20:56:57 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = FetchCompileWasmTemplatePlugin;
|