<commit_before>import typescript from 'rollup-plugin-typescript2'
import replace from 'rollup-plugin-replace'
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
import copy from 'rollup-plugin-copy'


const comment = '/* removed in browser build */'
const ignoredWarnings = ['UNUSED_EXTERNAL_IMPORT']

const tsOpts = {
  cacheRoot: './node_modules/.rpt2',
  typescript: require('typescript'),
  tsconfig: 'tsconfig.build.json',
  tsconfigOverride: {
    compilerOptions: {
      // Don't emit declarations, that's done by the regular build.
      declaration: false,
      module: 'ESNext',
    },
  },
}

export default [
  // Build 1: ES6 modules for Node.
  {
    input: 'src/awilix.ts',
    external: ['glob', 'path', 'util', 'camel-case', './load-module-native.js'],
    treeshake: { moduleSideEffects: 'no-external' },
    onwarn,
    output: [
      {
        file: 'lib/awilix.module.js',
        format: 'es',
      },
    ],
    plugins: [
      // Copy the native module loader
      copy({
        targets: [{ src: 'src/load-module-native.js', dest: 'lib' }]
      }),
      typescript(tsOpts)
    ],
  },
  // Build 2: ES modules for browser builds.
  {
    input: 'src/awilix.ts',
    external: ['glob', 'path', 'util', './load-module-native.js'],
    treeshake: { moduleSideEffects: 'no-external' },
    onwarn,
    output: [
      {
        name: 'Awilix',
        file: 'lib/awilix.browser.js',
        format: 'es',
      },
      {
        name: 'Awilix',
        file: 'lib/awilix.umd.js',
        format: 'umd',
      },
    ],
    plugins: [
      // Removes stuff that won't work in the browser
      // which also means node-only stuff like `path`, `util` and `glob`
      // will be shaken off.
      replace({
        'loadModules,':
          'loadModules: () => { throw new Error("loadModules is not supported in the browser.") },',
        '[util.inspect.custom]: inspect,': comment,
        '[util.inspect.custom]: inspectCradle,': comment,
        'name === util.inspect.custom || ': '',
        "import { camelCase } from 'camel-case'":
          'const camelCase = null as any',
        "export * from './list-modules'": comment,
        "import * as util from 'util'": '',
        delimiters: ['', ''],<commit_msg>Removed unused external<commit_after>import typescript from 'rollup-plugin-typescript2'
import replace from 'rollup-plugin-replace'
import commonjs from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
import copy from 'rollup-plugin-copy'


const comment = '/* removed in browser build */'
const ignoredWarnings = ['UNUSED_EXTERNAL_IMPORT']

const tsOpts = {
  cacheRoot: './node_modules/.rpt2',
  typescript: require('typescript'),
  tsconfig: 'tsconfig.build.json',
  tsconfigOverride: {
    compilerOptions: {
      // Don't emit declarations, that's done by the regular build.
      declaration: false,
      module: 'ESNext',
    },
  },
}

export default [
  // Build 1: ES6 modules for Node.
  {
    input: 'src/awilix.ts',
    external: ['glob', 'path', 'util', 'camel-case', './load-module-native.js'],
    treeshake: { moduleSideEffects: 'no-external' },
    onwarn,
    output: [
      {
        file: 'lib/awilix.module.js',
        format: 'es',
      },
    ],
    plugins: [
      // Copy the native module loader
      copy({
        targets: [{ src: 'src/load-module-native.js', dest: 'lib' }]
      }),
      typescript(tsOpts)
    ],
  },
  // Build 2: ES modules for browser builds.
  {
    input: 'src/awilix.ts',
    external: ['glob', 'path', 'util'],
    treeshake: { moduleSideEffects: 'no-external' },
    onwarn,
    output: [
      {
        name: 'Awilix',
        file: 'lib/awilix.browser.js',
        format: 'es',
      },
      {
        name: 'Awilix',
        file: 'lib/awilix.umd.js',
        format: 'umd',
      },
    ],
    plugins: [
      // Removes stuff that won't work in the browser
      // which also means node-only stuff like `path`, `util` and `glob`
      // will be shaken off.
      replace({
        'loadModules,':
          'loadModules: () => { throw new Error("loadModules is not supported in the browser.") },',
        '[util.inspect.custom]: inspect,': comment,
        '[util.inspect.custom]: inspectCradle,': comment,
        'name === util.inspect.custom || ': '',
        "import { camelCase } from 'camel-case'":
          'const camelCase = null as any',
        "export * from './list-modules'": comment,
        "import * as util from 'util'": '',
        delimiters: ['', ''],
{'fraction_non_alphanumeric': 0.15852857455660171, 'fraction_numerical': 0.0021896211955331727, 'mean_word_length': 2.4217228464419476, 'pattern_counts': {'":': 6, '<': 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': '5853544', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1462, 'n_words': 367}