packages/extract-svg-sprite-webpack-plugin/lib/utils/helpers.js
function getModuleChunk(module) {
  let chunks;
  const webpackVersion = getWebpackMajorVersion();

  if (webpackVersion >= 4) {
    chunks = Array.from(module.chunksIterable);
  } else if (webpackVersion >= 3) {
    chunks = module.mapChunks();
  } else {
    chunks = module.chunks;
  }

  if (Array.isArray(chunks) && chunks.length > 0) {
    return chunks[chunks.length - 1];
  } else if (module.issuer) {
    return getModuleChunk(module.issuer);
  }

  return null;
}
function getModuleChunk(module) {
  let chunks;
  const webpackVersion = getWebpackMajorVersion();

  if (webpackVersion >= 4) {
    chunks = Array.from(module.chunksIterable);
  } else if (webpackVersion >= 3) {
    chunks = module.mapChunks();
  } else {
    chunks = module.chunks;
  }

  if (Array.isArray(chunks) && chunks.length > 0) {
    return chunks[chunks.length - 1];
  } else if (module.issuer) {
    return getModuleChunk(module.issuer);
  }

  return null;
}
Find nearest module chunk (not sure that is reliable method, but who cares).
@see http://stackoverflow.com/questions/43202761/how-to-determine-all-module-chunks-in-webpack
@param {NormalModule} module
@return {Chunk|null}