function buildConfig(isWebBuild = false) {
  /** @type {import('rollup').RollupOptions} */
  const config = {
    input: 'src/index.js',
    output: [
      {
        file: isWebBuild
          ? 'examples/browser/objectloader.web.js'
          : 'dist/objectloader.esm.js',
        format: 'esm',
        sourcemap,
        exports: 'default'
      },
      ...(isWebBuild
        ? []
        : [
            {
              file: 'dist/objectloader.js',
              format: 'cjs',
              sourcemap,
              exports: 'default'
            }
          ])
    ],
    plugins: [
      ...(isWebBuild
        ? [
            // Bundling in all deps in web build
            commonjs(),
            nodeResolve()
          ]
        : [
            // Cleaning dir only inside 'dist'
            clean({ targets: 'dist/*' })
          ]),
      babel({ babelHelpers: 'bundled' }),
      ...(isProd ? [terser()] : [])
    ],
    external: isWebBuild
      ? undefined
      : // In non web build we don't want to bundle in any deps
        Object.keys(pkg.dependencies || {}).map((d) => new RegExp(`^${d}(\\/.*)?$`))
  }

  return config
}
/**
 * Build config
 * @param {boolean} isWebBuild If set to true will generate a web-ready config with everything bundled into a single file
 * @returns {import('rollup').RollupOptions}
 */
Build config
@param {boolean} isWebBuild If set to true will generate a web-ready config with everything bundled into a single file
@returns {import('rollup').RollupOptions}
Build config @param { boolean } isWebBuild If set to true will generate a web - ready config with everything bundled into a single file @returns { import ( ' rollup ' ) . RollupOptions }
function buildConfig(isWebBuild = false) {
  const config = {
    input: 'src/index.js',
    output: [
      {
        file: isWebBuild
          ? 'examples/browser/objectloader.web.js'
          : 'dist/objectloader.esm.js',
        format: 'esm',
        sourcemap,
        exports: 'default'
      },
      ...(isWebBuild
        ? []
        : [
            {
              file: 'dist/objectloader.js',
              format: 'cjs',
              sourcemap,
              exports: 'default'
            }
          ])
    ],
    plugins: [
      ...(isWebBuild
        ? [
            commonjs(),
            nodeResolve()
          ]
        : [
            clean({ targets: 'dist/*' })
          ]),
      babel({ babelHelpers: 'bundled' }),
      ...(isProd ? [terser()] : [])
    ],
    external: isWebBuild
      ? undefined
      : 
        Object.keys(pkg.dependencies || {}).map((d) => new RegExp(`^${d}(\\/.*)?$`))
  }
  return config
}
function buildConfig ( isWebBuild = false ) { const config = { input : 'src/index.js' , output : [ { file : isWebBuild ? 'examples/browser/objectloader.web.js' : 'dist/objectloader.esm.js' , format : 'esm' , sourcemap , exports : 'default' } , ... ( isWebBuild ? [ ] : [ { file : 'dist/objectloader.js' , format : 'cjs' , sourcemap , exports : 'default' } ] ) ] , plugins : [ ... ( isWebBuild ? [ commonjs ( ) , nodeResolve ( ) ] : [ clean ( { targets : 'dist/*' } ) ] ) , babel ( { babelHelpers : 'bundled' } ) , ... ( isProd ? [ terser ( ) ] : [ ] ) ] , external : isWebBuild ? undefined : Object . keys ( pkg . dependencies || { } ) . map ( ( d ) => new RegExp ( ` ${ d } \\ ` ) ) } return config }
Build config
 @param {boolean} isWebBuild If set to true will generate a web-ready config with everything bundled into a single file
 @returns {import('rollup').RollupOptions}
Build config @param { boolean } isWebBuild If set to true will generate a web - ready config with everything bundled into a single file @returns { import ( ' rollup ' ) . RollupOptions }
/** @type {import('rollup').RollupOptions} */ // Bundling in all deps in web build // Cleaning dir only inside 'dist' // In non web build we don't want to bundle in any deps