项目原始demo,不改动
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

28 lines
658 B

  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const ConcatSource = require("webpack-sources").ConcatSource;
  7. class NodeChunkTemplatePlugin {
  8. apply(chunkTemplate) {
  9. chunkTemplate.plugin("render", function(modules, chunk) {
  10. const source = new ConcatSource();
  11. source.add(`exports.ids = ${JSON.stringify(chunk.ids)};\nexports.modules = `);
  12. source.add(modules);
  13. source.add(";");
  14. return source;
  15. });
  16. chunkTemplate.plugin("hash", function(hash) {
  17. hash.update("node");
  18. hash.update("3");
  19. });
  20. }
  21. }
  22. module.exports = NodeChunkTemplatePlugin;