2013-01-31 01:49:25 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2017-02-21 07:05:34 +08:00
|
|
|
"use strict";
|
|
|
|
|
2017-02-21 17:38:24 +08:00
|
|
|
const WebWorkerMainTemplatePlugin = require("./WebWorkerMainTemplatePlugin");
|
|
|
|
const WebWorkerChunkTemplatePlugin = require("./WebWorkerChunkTemplatePlugin");
|
|
|
|
const WebWorkerHotUpdateChunkTemplatePlugin = require("./WebWorkerHotUpdateChunkTemplatePlugin");
|
2013-01-31 01:49:25 +08:00
|
|
|
|
2017-02-21 07:05:34 +08:00
|
|
|
class WebWorkerTemplatePlugin {
|
|
|
|
apply(compiler) {
|
2017-12-06 22:01:25 +08:00
|
|
|
compiler.hooks.thisCompilation.tap("WebWorkerTemplatePlugin", (compilation) => {
|
2017-12-20 16:53:33 +08:00
|
|
|
new WebWorkerMainTemplatePlugin().apply(compilation.mainTemplate);
|
|
|
|
new WebWorkerChunkTemplatePlugin().apply(compilation.chunkTemplate);
|
|
|
|
new WebWorkerHotUpdateChunkTemplatePlugin().apply(compilation.hotUpdateChunkTemplate);
|
2017-02-21 07:05:34 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2013-01-31 01:49:25 +08:00
|
|
|
module.exports = WebWorkerTemplatePlugin;
|