code: function resolveFile(file) {
    const files = [file];
    const fileDir = path.dirname(require.resolve(file));
    const fileData = fs.readFileSync(file).toString();
    const regexp = /require\(['|"](.*)['|"]\)/g;
  
    while (regexp.exec(fileData) !== null) {
      const moduleFile = RegExp.$1;
      if (!isNativeModule(moduleFile)) {
        const modulePath = path.join(fileDir, moduleFile);
        files.push(require.resolve(modulePath));
      }
    }
  
    return files;
  }
docs: 依赖获取函数
  @param {String} file