generateBundle(_, bundle) {
      if (totalHelpers.length === 0) {
        return;
      }

      const helperModule = createHelperModule(totalHelpers, format, minify);
      const helperId = this.emitFile({
        name: 'babel-helpers.js',
        type: 'asset',
        source: helperModule,
      });
      const helperFileName = this.getFileName(helperId);

      const chunks = Object.values(bundle).filter(file => file.type === 'chunk');

      for (const chunk of chunks) {
        const importSpecifier = getHelperImportSpecifier(this.parse(chunk.code), format);
        if (importSpecifier) {
          const fileDepth = chunk.fileName.split('/').length - 1;
          const helperDir = fileDepth === 0 ? './' : '../'.repeat(fileDepth);
          const helperImport = `"${helperDir}${helperFileName}"`;
          // @ts-ignore
          const ms = new MagicString(chunk.code);
          ms.overwrite(importSpecifier.start, importSpecifier.end, helperImport);
          chunk.code = ms.toString();
        }
      }
    }
Creates babel helpers chunk based on used helpers, and rewrites imports to the
babel helpers chunk using the hashed babel helpers filename.