2017-11-10 18:02:24 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const WebAssemblyParser = require("./WebAssemblyParser");
|
|
|
|
|
|
|
|
class WebAssemblyModulesPlugin {
|
|
|
|
apply(compiler) {
|
2017-12-06 22:01:25 +08:00
|
|
|
compiler.hooks.compilation.tap("WebAssemblyModulesPlugin", (compilation, {
|
2017-11-12 01:48:29 +08:00
|
|
|
normalModuleFactory
|
|
|
|
}) => {
|
2017-11-10 18:02:24 +08:00
|
|
|
normalModuleFactory.plugin("create-parser webassembly/experimental", () => {
|
|
|
|
return new WebAssemblyParser();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = WebAssemblyModulesPlugin;
|