ParkeTgo

Untitled

Sep 5th, 2018
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const MyPlugin = {
  2.     apply: compiler => {
  3.         compiler.hooks.compilation.tap("MyPlugin", compilation => {
  4.             compilation.hooks.succeedModule.tap("MyPlugin", module => {
  5.                 if (module.rawRequest && module.rawRequest.startsWith("pure-loader")) {
  6.                     Array.from(compilation.fileTimestamps.keys())
  7.                         .forEach(rs => {
  8.                             if (typeof rs === "string")
  9.                                 compilation.fileTimestamps.set(rs, fs.statSync(rs).mtime);
  10.                         });
  11.                     });
  12.                 }
  13.                 return null;
  14.             });
  15.         });
  16.     }
  17. };
Advertisement
Add Comment
Please, Sign In to add comment