src/vuegister.js
function unregister() {
  let list = [];

  // removes module and all its children from the node's require cache
  let unload = (id) => {
    let module = require.cache[id];

    if (!module) return;

    module.children.forEach((child) => unload(child.id));
    delete require.cache[id];
    list.push(id);
  };

  let sourceMapSupport = require.resolve('source-map-support');

  Object.keys(require.cache).forEach((key) => {
    if (path.extname(key) === VUE_EXT || key === sourceMapSupport) {
      unload(key);
    }
  });

  if (has(require.extensions, VUE_EXT)) {
    delete require.extensions[VUE_EXT];
  }

  if (has(Error, 'prepareStackTrace')) {
    delete Error.prepareStackTrace;
  }

  sourceMapsCache.clear();

  return list;
}
function unregister() {
  let list = [];

  // removes module and all its children from the node's require cache
  let unload = (id) => {
    let module = require.cache[id];

    if (!module) return;

    module.children.forEach((child) => unload(child.id));
    delete require.cache[id];
    list.push(id);
  };

  let sourceMapSupport = require.resolve('source-map-support');

  Object.keys(require.cache).forEach((key) => {
    if (path.extname(key) === VUE_EXT || key === sourceMapSupport) {
      unload(key);
    }
  });

  if (has(require.extensions, VUE_EXT)) {
    delete require.extensions[VUE_EXT];
  }

  if (has(Error, 'prepareStackTrace')) {
    delete Error.prepareStackTrace;
  }

  sourceMapsCache.clear();

  return list;
}
function unregister ( ) { let list = [ ] ; // removes module and all its children from the node's require cache let unload = ( id ) => { let module = require . cache [ id ] ; if ( ! module ) return ; module . children . forEach ( ( child ) => unload ( child . id ) ) ; delete require . cache [ id ] ; list . push ( id ) ; } ; let sourceMapSupport = require . resolve ( 'source-map-support' ) ; Object . keys ( require . cache ) . forEach ( ( key ) => { if ( path . extname ( key ) === VUE_EXT || key === sourceMapSupport ) { unload ( key ) ; } } ) ; if ( has ( require . extensions , VUE_EXT ) ) { delete require . extensions [ VUE_EXT ] ; } if ( has ( Error , 'prepareStackTrace' ) ) { delete Error . prepareStackTrace ; } sourceMapsCache . clear ( ) ; return list ; }
Removes requre hook.

@alias module:vuegister
@return {array} Returns list of unloaded modules.
Removes requre hook .