DllModule.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const Module = require("./Module");
  7. const RawSource = require("webpack-sources").RawSource;
  8. class DllModule extends Module {
  9. constructor(context, dependencies, name, type) {
  10. super();
  11. this.context = context;
  12. this.dependencies = dependencies;
  13. this.name = name;
  14. this.built = false;
  15. this.cacheable = true;
  16. this.type = type;
  17. }
  18. identifier() {
  19. return `dll ${this.name}`;
  20. }
  21. readableIdentifier() {
  22. return `dll ${this.name}`;
  23. }
  24. disconnect() {
  25. this.built = false;
  26. super.disconnect();
  27. }
  28. build(options, compilation, resolver, fs, callback) {
  29. this.built = true;
  30. return callback();
  31. }
  32. source() {
  33. return new RawSource("module.exports = __webpack_require__;");
  34. }
  35. needRebuild() {
  36. return false;
  37. }
  38. size() {
  39. return 12;
  40. }
  41. updateHash(hash) {
  42. hash.update("dll module");
  43. hash.update(this.name || "");
  44. super.updateHash(hash);
  45. }
  46. }
  47. module.exports = DllModule;