import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
//import resolve from '@rollup/plugin-node-resolve'

export default [
  {
    input: 'index.js',
    output: {
      file: 'dist/index.cjs',
      format: 'cjs',
      exports: 'named'
    },
    plugins: [
      json(),
      commonjs()
    ],
    external: [
      'assert',
      'nearley',
      'randexp'
    ]
  }
]

import commonjs from '@rollup/plugin-commonjs'
import replace from '@rollup/plugin-replace'

export default [
  {
    input: 'index.js',
    output: {
      file: 'dist/index.cjs',
      format: 'cjs',
      exports: 'named'
    },
    plugins: [
      replace({
        preventAssignment: false,
        delimiters: ['`', '`'],
        values: {
          '${locale}.json': '`../locale-data/${locale}.json`'
        }
      }),
      commonjs()
    ],
    external: [
      'assert',
      'fs',
      'nearley',
      'randexp'
    ]
  }
]

Make sure locales are found in CJS bundle
Make sure locales are found in CJS bundle
