2017-11-12 01:48:29 +08:00
|
|
|
/*
|
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
|
*/
|
|
|
|
|
"use strict";
|
|
|
|
|
|
2018-03-14 22:02:09 +08:00
|
|
|
const FetchCompileWasmMainTemplatePlugin = require("../web/FetchCompileWasmMainTemplatePlugin");
|
2017-12-14 08:21:44 +08:00
|
|
|
const WasmModuleTemplatePlugin = require("../wasm/WasmModuleTemplatePlugin");
|
2017-11-12 01:48:29 +08:00
|
|
|
|
|
|
|
|
class ReadFileCompileWasmTemplatePlugin {
|
|
|
|
|
apply(compiler) {
|
2018-02-25 09:00:20 +08:00
|
|
|
compiler.hooks.thisCompilation.tap(
|
|
|
|
|
"ReadFileCompileWasmTemplatePlugin",
|
|
|
|
|
compilation => {
|
2018-03-14 22:02:09 +08:00
|
|
|
new FetchCompileWasmMainTemplatePlugin().apply(
|
2018-02-25 09:00:20 +08:00
|
|
|
compilation.mainTemplate
|
|
|
|
|
);
|
|
|
|
|
new WasmModuleTemplatePlugin().apply(
|
|
|
|
|
compilation.moduleTemplates.javascript
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
);
|
2017-11-12 01:48:29 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = ReadFileCompileWasmTemplatePlugin;
|