neutrino.js 406 B

123456789101112131415
  1. const SpeedMeasurePlugin = require(".");
  2. const smp = new SpeedMeasurePlugin();
  3. module.exports = neutrino => {
  4. const origConfig = neutrino.config;
  5. const wrappedConfig = smp.wrap(origConfig.toConfig());
  6. neutrino.config = new Proxy(origConfig, {
  7. get(target, property) {
  8. if (property === "toConfig") {
  9. return () => wrappedConfig;
  10. }
  11. return target[property];
  12. },
  13. });
  14. };