index.js
function indexTemplate(format, data) {
  if (format === 'cjs') {
    return `module.exports = require('${data.main}')`
  }
  if (format === 'esm') {
    return `import ${data.name} from '${data.main}'

export default ${data.name}`
  }
}
function indexTemplate(format, data) {
  if (format === 'cjs') {
    return `module.exports = require('${data.main}')`
  }
  if (format === 'esm') {
    return `import ${data.name} from '${data.main}'

export default ${data.name}`
  }
}
function indexTemplate ( format , data ) { if ( format === 'cjs' ) { return ` ${ data . main } ` } if ( format === 'esm' ) { return ` ${ data . name } ${ data . main } ${ data . name } ` } }
Utility functions.
@private
 
Create contents for an index.js file.
@param {String} format The format to use. 'cjs' or 'esm'.
@param {Object} data The data to use as part of the template.
Utility functions .