You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
814 B

4 years ago
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const WebWorkerMainTemplatePlugin = require("./WebWorkerMainTemplatePlugin");
  7. const WebWorkerChunkTemplatePlugin = require("./WebWorkerChunkTemplatePlugin");
  8. const WebWorkerHotUpdateChunkTemplatePlugin = require("./WebWorkerHotUpdateChunkTemplatePlugin");
  9. class WebWorkerTemplatePlugin {
  10. apply(compiler) {
  11. compiler.hooks.thisCompilation.tap(
  12. "WebWorkerTemplatePlugin",
  13. compilation => {
  14. new WebWorkerMainTemplatePlugin().apply(compilation.mainTemplate);
  15. new WebWorkerChunkTemplatePlugin().apply(compilation.chunkTemplate);
  16. new WebWorkerHotUpdateChunkTemplatePlugin().apply(
  17. compilation.hotUpdateChunkTemplate
  18. );
  19. }
  20. );
  21. }
  22. }
  23. module.exports = WebWorkerTemplatePlugin;