<commit_before>import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from "@rollup/plugin-typescript"
import {terser} from "rollup-plugin-terser"

import * as pkg from './package.json'


const makeConfigForOutput = (output) => ({
  input: './lib/index.ts',
  output,
  plugins: [
    typescript(),
    resolve({
      jsnext: true,
      main: true,
      browser: true,
    }),
    commonjs({extensions: ['.ts', '.js']}),
    terser({
      format: {
        comments: false,
        ecma: 5
      }
    })
  ]
})

export default [
  makeConfigForOutput({
    file: pkg.main,
    format: 'umd',
    name: 'contentfulExtension',
  }),
  makeConfigForOutput([
    {format: 'es', file: pkg.module},
  ])
]<commit_msg>chore: use commonjs in rollup config<commit_after>const resolve = require('@rollup/plugin-node-resolve')
const commonjs = require('@rollup/plugin-commonjs')
const typescript = require('@rollup/plugin-typescript')
const { terser } = require('rollup-plugin-terser')

const pkg = require('./package.json')

const makeConfigForOutput = output => ({
  input: './lib/index.ts',
  output,
  plugins: [
    typescript(),
    resolve({
      jsnext: true,
      main: true,
      browser: true
    }),
    commonjs({ extensions: ['.ts', '.js'] }),
    terser({
      format: {
        comments: false,
        ecma: 5
      }
    })
  ]
})

module.exports = [
  makeConfigForOutput({
    file: pkg.main,
    format: 'umd',
    name: 'contentfulExtension'
  }),
  makeConfigForOutput([{ format: 'es', file: pkg.module }])
]
{'fraction_non_alphanumeric': 0.16216216216216217, 'fraction_numerical': 0.001257071024512885, 'mean_word_length': 2.98, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '182590', 'n_tokens_mistral': 532, 'n_tokens_neox': 521, 'n_words': 117}