# Snapshot report for `test/function.js`

The actual snapshot is saved in `function.js.snap`.

Generated by [AVA](https://avajs.dev).

## assign-properties-to-default-export

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = {exports: {}};␊
      ␊
      const foo$1 = {};␊
      ␊
      foo.exports = foo$1;␊
      foo.exports.bar = 1;␊
      ␊
      var foo$2 = foo.exports;␊
      ␊
      t.is(foo$2.bar, 1);␊
      `,
    }

## assumed-globals

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var document$1 = {exports: {}};␊
      ␊
      /* eslint-disable */␊
      ␊
      if (typeof document !== 'undefined') {␊
        document$1.exports = document;␊
      } else {␊
        document$1.exports = { fake: true };␊
      }␊
      ␊
      var document$2 = document$1.exports;␊
      ␊
      t.deepEqual(document$2, { real: true });␊
      `,
    }

## bare-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Math.bar = 42;␊
      ␊
      t.is(Math.bar, 42);␊
      `,
    }

## bare-import-comment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      // Great module␊
      Math.bar = 42;␊
      ␊
      t.is(Math.bar, 42);␊
      `,
    }

## basic

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = 21;␊
      ␊
      const foo$1 = foo;␊
      ␊
      var main = foo$1 * 2;␊
      ␊
      module.exports = main;␊
      `,
    }

## circular-dependencies

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      const main$1 = main;␊
      ␊
      dep.getMain = () => main$1;␊
      ␊
      const dep$1 = dep;␊
      ␊
      var foo = main.foo = 'foo';␊
      t.is(dep$1.getMain().foo, 'foo');␊
      ␊
      exports.default = main;␊
      exports.foo = foo;␊
      `,
    }

## circular-dependencies-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      (function (exports) {␊
      const main$1 = main;␊
      ␊
      addExports(exports);␊
      ␊
      function addExports(exported) {␊
        // eslint-disable-next-line no-param-reassign␊
        exported.getMain = () => main$1;␊
      }␊
      }(dep));␊
      ␊
      (function (exports) {␊
      const dep$1 = dep;␊
      ␊
      addExports();␊
      t.is(dep$1.getMain().foo, 'foo');␊
      ␊
      function addExports(exported) {␊
        // eslint-disable-next-line no-param-reassign␊
        exports.foo = 'foo';␊
      }␊
      }(main));␊
      ␊
      exports.default = main;␊
      `,
    }

## dash-name

> Snapshot 1

    {
      'bundle.js': `'use strict';␊
      ␊
      var dashName = true;␊
      ␊
      t.truthy(dashName);␊
      `,
    }

## deconflict-export-and-local

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var someValue = {};␊
      ␊
      someValue.someValue = 10;␊
      ␊
      const someValueModule = someValue;␊
      ␊
      var someValue$1 = someValueModule.someValue;␊
      ␊
      t.is(someValue$1, 10);␊
      `,
    }

## dot

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo_bar = 'fubar';␊
      ␊
      const status = foo_bar;␊
      ␊
      t.is(status, 'fubar');␊
      ␊
      module.exports = main;␊
      `,
    }

## double-exports-assignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep = {};␊
      ␊
      dep.foo = 'first';␊
      dep.foo = 'second';␊
      ␊
      t.is(dep.foo, 'second');␊
      `,
    }

## double-exports-assignment-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = 'first';␊
      foo = 'second';␊
      ␊
      t.is(foo, 'second');␊
      `,
    }

## double-module-exports-assignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep = 'first';␊
      dep = 'second';␊
      ␊
      var dep$1 = dep;␊
      ␊
      t.is(dep$1, 'second');␊
      `,
    }

## duplicate-default-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      const x$1 = {};␊
      ␊
      x.exports = x$1;␊
      x.exports.default = x$1;␊
      ␊
      var x$2 = x.exports;␊
      ␊
      t.is(x$2.default, x$2);␊
      `,
    }

## duplicate-default-exports-b

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      const x$1 = {};␊
      ␊
      x.exports = x$1;␊
      x.exports.default = 42;␊
      ␊
      var x$2 = x.exports;␊
      ␊
      t.deepEqual(x$2, { default: 42 });␊
      `,
    }

## duplicate-default-exports-c

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var exports$1 = {};␊
      ␊
      var Foo = exports$1.Foo = 1;␊
      var _var = exports$1.var = 'VAR';␊
      exports$1.default = {␊
        Foo: 2,␊
        default: 3␊
      };␊
      ␊
      /* eslint-disable */␊
      ␊
      t.is(exports$1.Foo, 1);␊
      t.is(exports$1.var, 'VAR');␊
      t.deepEqual(exports$1.default, { Foo: 2, default: 3 });␊
      t.is(exports$1.default.Foo, 2);␊
      t.is(exports$1.default.default, 3);␊
      t.is(Foo, 1);␊
      t.is(_var, 'VAR');␊
      `,
    }

## dynamic-module-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function createModule(modulePath) {␊
      	return {␊
      		path: modulePath,␊
      		exports: {},␊
      		require: function (path, base) {␊
      			return commonjsRequire(path, base == null ? modulePath : base);␊
      		}␊
      	};␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = createModule("/$$rollup_base$$/fixtures/function/dynamic-module-require");␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-module-require/submodule.js", function (module, exports) {␊
        module.exports = function () {␊
        return 'Hello there';␊
      };␊
      ␊
      });␊
      ␊
      (function (module) {␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      function takeModule(withName) {␊
        return module.require(`./${withName}`);␊
      }␊
      ␊
      try {␊
        const submodule = takeModule('submodule');␊
        message = submodule();␊
      } catch (err) {␊
        ({ message } = err);␊
      }␊
      ␊
      t.is(message, 'Hello there');␊
      }(main));␊
      ␊
      var main$1 = main.exports;␊
      ␊
      module.exports = main$1;␊
      `,
    }

## dynamic-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require/submodule.js", function (module, exports) {␊
        module.exports = function () {␊
        return 'Hello there';␊
      };␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(`./${withName}`,"/$$rollup_base$$/fixtures/function/dynamic-require");␊
      }␊
      ␊
      try {␊
        const submodule = takeModule('submodule');␊
        message = submodule();␊
      } catch (err) {␊
        ({ message } = err);␊
      }␊
      ␊
      t.is(message, 'Hello there');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-absolute-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/sub/node_modules/module/direct.js", function (module, exports) {␊
        module.exports = 'direct';␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/sub/node_modules/module/nested/nested.js", function (module, exports) {␊
        module.exports = 'nested';␊
      ␊
      });␊
      ␊
      const commonjsRegister$3 = commonjsRegister;␊
      commonjsRegister$3("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/node_modules/parent-module/parent.js", function (module, exports) {␊
        module.exports = 'parent';␊
      ␊
      });␊
      ␊
      var submodule = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return commonjsRequire(name,"/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/sub");␊
      }␊
      ␊
      submodule.moduleDirect = takeModule('module/direct');␊
      submodule.moduleNested = takeModule('module/nested/nested');␊
      submodule.parentModule = takeModule('parent-module/parent');␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      t.deepEqual(submodule, {␊
        moduleDirect: 'direct',␊
        moduleNested: 'nested',␊
        parentModule: 'parent'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-cache-reference

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module/index.js", function (module, exports) {␊
        module.exports = {␊
        foo: 'bar',␊
      };␊
      ␊
      });␊
      ␊
      function mv(from, to) {␊
        for (let [key, value] of Object.entries(from)) {␊
          to[key] = value;␊
        }␊
      }␊
      ␊
      function clear(obj) {␊
        for (let key of Array.from(Object.keys(obj))) {␊
          delete obj[key];␊
        }␊
      }␊
      ␊
      var stealthy = function stealth(cacheObject, cb) {␊
        let orig = Object.create(null);␊
      ␊
        mv(cacheObject, orig);␊
        clear(cacheObject);␊
      ␊
        let res = cb();␊
      ␊
        clear(cacheObject);␊
        mv(orig, cacheObject);␊
      ␊
        return res;␊
      };␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module2/index.js", function (module, exports) {␊
        const stealthRequire = stealthy;␊
      ␊
      module.exports = stealthRequire(commonjsRequire.cache, () => {␊
        let m = commonjsRequire("custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module2");␊
        m.foo = 'baz';␊
        return m;␊
      });␊
      ␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module/index.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module2", "/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference/node_modules/custom-module2/index.js");␊
      ␊
      const a = commonjsRequire("custom-module2", "/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference");␊
      const b = commonjsRequire("custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-cache-reference");␊
      ␊
      t.is(a.foo, 'baz');␊
      t.is(b.foo, 'bar');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-code-splitting

> Snapshot 1

    {
      'generated-lib2.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-code-splitting/target1.js", function (module, exports) {␊
        module.exports = '1';␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-code-splitting/target2.js", function (module, exports) {␊
        module.exports = '2';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      for (const index of [1, 2]) {␊
        try {␊
          message = commonjsRequire(`./target${index}.js`,"/$$rollup_base$$/fixtures/function/dynamic-require-code-splitting");␊
        } catch (err) {␊
          ({ message } = err);␊
        }␊
        t.is(message, index.toString());␊
      }␊
      ␊
      exports.commonjsRequire = commonjsRequire;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var lib2 = require('./generated-lib2.js');␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      let message;␊
      ␊
      for (const index of [1, 2]) {␊
        try {␊
          message = lib2.commonjsRequire(`./target${index}.js`,"/$$rollup_base$$/fixtures/function/dynamic-require-code-splitting");␊
        } catch (err) {␊
          ({ message } = err);␊
        }␊
        t.is(message, index.toString());␊
      }␊
      `,
      'main2.js': `'use strict';␊
      ␊
      require('./generated-lib2.js');␊
      ␊
      `,
    }

## dynamic-require-es-entry

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-es-entry/submodule.js", function (module, exports) {␊
        module.exports = 'submodule';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(`./${withName}`,"/$$rollup_base$$/fixtures/function/dynamic-require-es-entry");␊
      }␊
      ␊
      var importer = takeModule('submodule.js');␊
      ␊
      t.is(importer, 'submodule');␊
      `,
    }

## dynamic-require-extensions

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-extensions/submodule.js", function (module, exports) {␊
        module.exports = { name: 'submodule', value: null };␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(`./${withName}`,"/$$rollup_base$$/fixtures/function/dynamic-require-extensions");␊
      }␊
      ␊
      const withExtension = takeModule('submodule.js');␊
      const withoutExtension = takeModule('submodule');␊
      ␊
      t.is(withExtension.name, 'submodule');␊
      t.is(withoutExtension.name, 'submodule');␊
      ␊
      withExtension.value = 'mutated';␊
      ␊
      t.is(withoutExtension.value, 'mutated');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return require(withName);␊
      }␊
      ␊
      // The bundled code will run from test/helpers/util.js␊
      t.is(takeModule('../fixtures/function/dynamic-require-fallback/dep.js'), 'dep');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-from-es-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-from-es-import/submodule.js", function (module, exports) {␊
        module.exports = 'submodule';␊
      ␊
      });␊
      ␊
      var submodule = commonjsRequire("/$$rollup_base$$/fixtures/function/dynamic-require-from-es-import/submodule.js", "/$$rollup_base$$/fixtures/function/dynamic-require-from-es-import");␊
      ␊
      t.is(submodule, 'submodule');␊
      `,
    }

## dynamic-require-globs

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-globs/submodule1.js", function (module, exports) {␊
        module.exports = 'submodule1';␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-globs/submodule2.js", function (module, exports) {␊
        module.exports = 'submodule2';␊
      ␊
      });␊
      ␊
      const commonjsRegister$3 = commonjsRegister;␊
      commonjsRegister$3("/$$rollup_base$$/fixtures/function/dynamic-require-globs/extramodule1.js", function (module, exports) {␊
        module.exports = 'extramodule1';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(`./${withName}`,"/$$rollup_base$$/fixtures/function/dynamic-require-globs");␊
      }␊
      ␊
      t.is(takeModule('submodule1.js'), 'submodule1');␊
      t.is(takeModule('submodule2.js'), 'submodule2');␊
      t.is(takeModule('extramodule1.js'), 'extramodule1');␊
      t.throws(() => takeModule('extramodule2.js'), {␊
        message:␊
          'Could not dynamically require "./extramodule2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-instances

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-instances/direct/index.js", function (module, exports) {␊
        module.exports = { name: 'direct', value: null };␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-instances/package/main.js", function (module, exports) {␊
        module.exports = { name: 'package', value: null };␊
      ␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-instances/direct", "/$$rollup_base$$/fixtures/function/dynamic-require-instances/direct/index.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-instances/package", "/$$rollup_base$$/fixtures/function/dynamic-require-instances/package/main.js");␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(withName,"/$$rollup_base$$/fixtures/function/dynamic-require-instances");␊
      }␊
      ␊
      takeModule('./direct').value = 'direct-instance';␊
      t.is(takeModule('./direct/index.js').value, 'direct-instance');␊
      t.is(commonjsRequire("./direct/index.js", "/$$rollup_base$$/fixtures/function/dynamic-require-instances").value, 'direct-instance');␊
      ␊
      takeModule('./package').value = 'package-instance';␊
      t.is(takeModule('./package/main.js').value, 'package-instance');␊
      t.is(commonjsRequire("./package/main.js", "/$$rollup_base$$/fixtures/function/dynamic-require-instances").value, 'package-instance');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-json

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      var value = "present";␊
      var require$$1 = {␊
      	value: value␊
      };␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-json/dynamic.json", function (module, exports) {␊
        module.exports = require$$1;␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(`./${withName}`,"/$$rollup_base$$/fixtures/function/dynamic-require-json");␊
      }␊
      ␊
      t.deepEqual(takeModule('dynamic.json'), { value: 'present' });␊
      t.deepEqual(takeModule('dynamic'), { value: 'present' });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-no-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire (path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(withName);␊
      }␊
      ␊
      t.throws(() => takeModule('./dep.js'), {␊
        message:␊
          'Could not dynamically require "./dep.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-package

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-package/entry.js", function (module, exports) {␊
        module.exports = 'same-directory';␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-package/sub/entry.js", function (module, exports) {␊
        module.exports = 'sub';␊
      ␊
      });␊
      ␊
      const commonjsRegister$3 = commonjsRegister;␊
      commonjsRegister$3("/$$rollup_base$$/fixtures/function/dynamic-require-package/node_modules/custom-module/entry.js", function (module, exports) {␊
        module.exports = 'custom-module';␊
      ␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-package", "/$$rollup_base$$/fixtures/function/dynamic-require-package/entry.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-package/sub", "/$$rollup_base$$/fixtures/function/dynamic-require-package/sub/entry.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-package/node_modules/custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-package/node_modules/custom-module/entry.js");␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return commonjsRequire(name,"/$$rollup_base$$/fixtures/function/dynamic-require-package/sub");␊
      }␊
      ␊
      var sub = {␊
        parent: takeModule('..'),␊
        customModule: takeModule('custom-module')␊
      };␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule$1(name) {␊
        return commonjsRequire(name,"/$$rollup_base$$/fixtures/function/dynamic-require-package");␊
      }␊
      ␊
      t.is(takeModule$1('.'), 'same-directory');␊
      t.is(takeModule$1('./'), 'same-directory');␊
      t.is(takeModule$1('.//'), 'same-directory');␊
      ␊
      t.is(takeModule$1('./sub'), 'sub');␊
      ␊
      t.is(takeModule$1('custom-module'), 'custom-module');␊
      t.deepEqual(sub, { parent: 'same-directory', customModule: 'custom-module' });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-package-sub

> Snapshot 1

    {
      'entry.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var entry = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module/entry.js", function (module, exports) {␊
        module.exports = 'custom-module';␊
      ␊
      });␊
      ␊
      var main = "./entry.js";␊
      var require$$1 = {␊
      	main: main␊
      };␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module/package.json", function (module, exports) {␊
        module.exports = require$$1;␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module/entry.js");␊
      ␊
      t.is(commonjsRequire("custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/sub"), 'custom-module');␊
      ␊
      module.exports = entry;␊
      `,
    }

## dynamic-require-relative-paths

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-relative-paths/sub/submodule.js", function (module, exports) {␊
        module.exports = 'submodule';␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-relative-paths/sub/subsub/subsubmodule.js", function (module, exports) {␊
        module.exports = 'subsubmodule';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModuleWithDelimiter(name, delimiter) {␊
        return commonjsRequire(`.${delimiter}${name.replace(/=/g, delimiter)}`,"/$$rollup_base$$/fixtures/function/dynamic-require-relative-paths");␊
      }␊
      ␊
      t.is(takeModuleWithDelimiter('sub=submodule.js', '/'), 'submodule');␊
      t.is(takeModuleWithDelimiter('sub=subsub=subsubmodule.js', '/'), 'subsubmodule');␊
      t.is(takeModuleWithDelimiter('sub=submodule.js', '\\\\'), 'submodule');␊
      t.is(takeModuleWithDelimiter('sub=subsub=subsubmodule.js', '\\\\'), 'subsubmodule');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-resolve-index

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/index.js", function (module, exports) {␊
        module.exports = 'same-directory';␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/sub/index.js", function (module, exports) {␊
        module.exports = 'sub';␊
      ␊
      });␊
      ␊
      const commonjsRegister$3 = commonjsRegister;␊
      commonjsRegister$3("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module/index.js", function (module, exports) {␊
        module.exports = 'custom-module';␊
      ␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index", "/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/index.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/sub", "/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/sub/index.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module/index.js");␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return commonjsRequire(name,"/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/sub");␊
      }␊
      ␊
      var sub = {␊
        parent: takeModule('..'),␊
        customModule: takeModule('custom-module')␊
      };␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule$1(name) {␊
        return commonjsRequire(name,"/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index");␊
      }␊
      ␊
      t.is(takeModule$1('.'), 'same-directory');␊
      t.is(takeModule$1('./'), 'same-directory');␊
      t.is(takeModule$1('.//'), 'same-directory');␊
      ␊
      t.is(takeModule$1('./sub'), 'sub');␊
      ␊
      t.is(takeModule$1('custom-module'), 'custom-module');␊
      t.deepEqual(sub, { parent: 'same-directory', customModule: 'custom-module' });␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-resolve-reference

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module/index.js", function (module, exports) {␊
        module.exports = {␊
        foo: 'bar',␊
      };␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2/index.js", function (module, exports) {␊
        module.exports = () => {␊
        return commonjsRequire.resolve('custom-module',"/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2");␊
      };␊
      ␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module/index.js");␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2", "/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2/index.js");␊
      ␊
      t.is(␊
        commonjsRequire("custom-module2", "/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference")(),␊
        '/$$rollup_base$$/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module'␊
      );␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-root-circular

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      function commonjsRegisterOrShort (path, to) {␊
      	const resolvedPath = commonjsResolveImpl(path, null);␊
      	if (resolvedPath !== null && DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      	  DYNAMIC_REQUIRE_CACHE[path] = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      	} else {␊
      	  DYNAMIC_REQUIRE_SHORTS[path] = to;␊
      	}␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-root-circular/node_modules/custom-module/index.js", function (module, exports) {␊
        const circular = commonjsRequire("./lib/circular", "/$$rollup_base$$/fixtures/function/dynamic-require-root-circular/node_modules/custom-module");␊
      ␊
      circular.extend1(module.exports);␊
      ␊
      module.exports.get1 = function () {␊
        return 'all good';␊
      };␊
      ␊
      circular.extend2(module.exports);␊
      ␊
      });␊
      ␊
      const commonjsRegister$2 = commonjsRegister;␊
      commonjsRegister$2("/$$rollup_base$$/fixtures/function/dynamic-require-root-circular/node_modules/custom-module/lib/circular.js", function (module, exports) {␊
        const lib = commonjsRequire("../", "/$$rollup_base$$/fixtures/function/dynamic-require-root-circular/node_modules/custom-module/lib");␊
      ␊
      module.exports.extend1 = function (exports) {␊
        exports.get2 = function () {␊
          return 'indirect ref';␊
        };␊
      };␊
      ␊
      module.exports.extend2 = function (exports) {␊
        exports.get3 = lib.get1;␊
      };␊
      ␊
      });␊
      ␊
      const commonjsRegisterOrShort$1 = commonjsRegisterOrShort;␊
      commonjsRegisterOrShort$1("/$$rollup_base$$/fixtures/function/dynamic-require-root-circular/node_modules/custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-root-circular/node_modules/custom-module/index.js");␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      const custom = commonjsRequire("custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-root-circular");␊
      ␊
      t.is(custom.get1(), 'all good');␊
      t.is(custom.get2(), 'indirect ref');␊
      t.is(custom.get3(), custom.get1());␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-targets-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-targets-fallback/dep1.js", function (module, exports) {␊
        module.exports = 'dep';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(withName,"/$$rollup_base$$/fixtures/function/dynamic-require-targets-fallback");␊
      }␊
      ␊
      t.is(takeModule('./dep1.js'), 'dep');␊
      // The bundled code will run from test/helpers/util.js␊
      t.is(takeModule('../fixtures/function/dynamic-require-targets-fallback/dep2.js'), 'dep');␊
      ␊
      module.exports = main;␊
      `,
    }

## dynamic-require-targets-no-fallback

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = Object.create(null);␊
      const DYNAMIC_REQUIRE_SHORTS = Object.create(null);␊
      const DEFAULT_PARENT_MODULE = {␊
      	id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []␊
      };␊
      const CHECKED_EXTENSIONS = ['', '.js', '.json'];␊
      ␊
      function normalize (path) {␊
      	path = path.replace(/\\\\/g, '/');␊
      	const parts = path.split('/');␊
      	const slashed = parts[0] === '';␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] === '.' || parts[i] === '') {␊
      			parts.splice(i--, 1);␊
      		}␊
      	}␊
      	for (let i = 1; i < parts.length; i++) {␊
      		if (parts[i] !== '..') continue;␊
      		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {␊
      			parts.splice(--i, 2);␊
      			i--;␊
      		}␊
      	}␊
      	path = parts.join('/');␊
      	if (slashed && path[0] !== '/')␊
      	  path = '/' + path;␊
      	else if (path.length === 0)␊
      	  path = '.';␊
      	return path;␊
      }␊
      ␊
      function join () {␊
      	if (arguments.length === 0)␊
      	  return '.';␊
      	let joined;␊
      	for (let i = 0; i < arguments.length; ++i) {␊
      	  let arg = arguments[i];␊
      	  if (arg.length > 0) {␊
      		if (joined === undefined)␊
      		  joined = arg;␊
      		else␊
      		  joined += '/' + arg;␊
      	  }␊
      	}␊
      	if (joined === undefined)␊
      	  return '.';␊
      ␊
      	return joined;␊
      }␊
      ␊
      function isPossibleNodeModulesPath (modulePath) {␊
      	let c0 = modulePath[0];␊
      	if (c0 === '/' || c0 === '\\\\') return false;␊
      	let c1 = modulePath[1], c2 = modulePath[2];␊
      	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||␊
      		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;␊
      	if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))␊
      		return false;␊
      	return true;␊
      }␊
      ␊
      function dirname (path) {␊
        if (path.length === 0)␊
          return '.';␊
      ␊
        let i = path.length - 1;␊
        while (i > 0) {␊
          const c = path.charCodeAt(i);␊
          if ((c === 47 || c === 92) && i !== path.length - 1)␊
            break;␊
          i--;␊
        }␊
      ␊
        if (i > 0)␊
          return path.substr(0, i);␊
      ␊
        if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)␊
          return path.charAt(0);␊
      ␊
        return '.';␊
      }␊
      ␊
      function commonjsResolveImpl (path, originalModuleDir, testCache) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	if (path[0] === '/') {␊
      		originalModuleDir = '/';␊
      	}␊
      	while (true) {␊
      		if (!shouldTryNodeModules) {␊
      			relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;␊
      		} else if (originalModuleDir) {␊
      			relPath = normalize(originalModuleDir + '/node_modules/' + path);␊
      		} else {␊
      			relPath = normalize(join('node_modules', path));␊
      		}␊
      ␊
      		if (relPath.endsWith('/..')) {␊
      			break; // Travelled too far up, avoid infinite loop␊
      		}␊
      ␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			if (DYNAMIC_REQUIRE_CACHE[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_SHORTS[resolvedPath]) {␊
      			  return resolvedPath;␊
      			}␊
      			if (DYNAMIC_REQUIRE_LOADERS[resolvedPath]) {␊
      				return resolvedPath;␊
      			}␊
      		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return null;␊
      }␊
      ␊
      function commonjsResolve (path, originalModuleDir) {␊
      	const resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
      		return resolvedPath;␊
      	}␊
      	return require.resolve(path);␊
      }␊
      ␊
      function commonjsRequire (path, originalModuleDir) {␊
      	let resolvedPath = commonjsResolveImpl(path, originalModuleDir);␊
      	if (resolvedPath !== null) {␊
          let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
          if (cachedModule) return cachedModule.exports;␊
          let shortTo = DYNAMIC_REQUIRE_SHORTS[resolvedPath];␊
          if (shortTo) {␊
            cachedModule = DYNAMIC_REQUIRE_CACHE[shortTo];␊
            if (cachedModule)␊
              return cachedModule.exports;␊
            resolvedPath = commonjsResolveImpl(shortTo, null);␊
          }␊
          const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
          if (loader) {␊
            DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
              id: resolvedPath,␊
              filename: resolvedPath,␊
              path: dirname(resolvedPath),␊
              exports: {},␊
              parent: DEFAULT_PARENT_MODULE,␊
              loaded: false,␊
              children: [],␊
              paths: [],␊
              require: function (path, base) {␊
                return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);␊
              }␊
            };␊
            try {␊
              loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
            } catch (error) {␊
              delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
              throw error;␊
            }␊
            cachedModule.loaded = true;␊
            return cachedModule.exports;␊
          }	}␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      commonjsRequire.resolve = commonjsResolve;␊
      ␊
      var main = {};␊
      ␊
      const commonjsRegister$1 = commonjsRegister;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-targets-no-fallback/dep1.js", function (module, exports) {␊
        module.exports = 'dep';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(withName) {␊
        return commonjsRequire(withName,"/$$rollup_base$$/fixtures/function/dynamic-require-targets-no-fallback");␊
      }␊
      ␊
      t.is(takeModule('./dep1.js'), 'dep');␊
      t.throws(() => takeModule('./dep2.js'), {␊
        message:␊
          'Could not dynamically require "./dep2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊
      });␊
      ␊
      module.exports = main;␊
      `,
    }

## es6-export-with-global-sniffing

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      let root;␊
      ␊
      if (typeof self !== 'undefined') {␊
        root = self;␊
      } else if (typeof window !== 'undefined') {␊
        root = window;␊
      } else if (typeof global !== 'undefined') {␊
        root = global;␊
      } else {␊
        root = module;␊
      }␊
      ␊
      root.pollution = 'foo';␊
      ␊
      const getGlobalPollution = () => 'foo';␊
      ␊
      // this test makes sure that "submodule" is not wrapped in commonjs␊
      ␊
      t.is(getGlobalPollution(), global.pollution);␊
      `,
    }

## esm-externals-false

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var require$$4 = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);␊
      ␊
      var main = {};␊
      ␊
      const externalExports = require$$0__default['default'];␊
      const externalModuleExports = require$$1__default['default'];␊
      const externalNamed = require$$2__default['default'];␊
      const externalMixed = require$$3__default['default'];␊
      const externalDefault = require$$4__default['default'];␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-function

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalExports = require$$0__default['default'];␊
      const externalModuleExports = require$$1__default['default'];␊
      const externalNamed = require$$2__default['default'];␊
      const externalMixed = require$$3__default['default'];␊
      const externalDefault = require$$4;␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-list

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalExports = require$$0__default['default'];␊
      const externalModuleExports = require$$1__default['default'];␊
      const externalNamed = require$$2__default['default'];␊
      const externalMixed = require$$3__default['default'];␊
      const externalDefault = require$$4;␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-true

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { default: 'bar', foo: 'foo' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## esm-externals-undefined

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      var require$$1 = require('external-cjs-module-exports');␊
      var require$$2 = require('external-esm-named');␊
      var require$$3 = require('external-esm-mixed');␊
      var require$$4 = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);␊
      var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);␊
      ␊
      var main = {};␊
      ␊
      const externalExports = require$$0__default['default'];␊
      const externalModuleExports = require$$1__default['default'];␊
      const externalNamed = require$$2__default['default'];␊
      const externalMixed = require$$3__default['default'];␊
      const externalDefault = require$$4__default['default'];␊
      ␊
      t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊
      t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## export-default-from

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = 'default export';␊
      ␊
      t.is(require$$0, 'default export');␊
      ␊
      module.exports = main;␊
      `,
    }

## exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = {};␊
      ␊
      foo.bar = 'BAR';␊
      foo.baz = 'BAZ';␊
      ␊
      const { bar } = foo;␊
      const { baz } = foo;␊
      ␊
      var main = bar + baz;␊
      ␊
      module.exports = main;␊
      `,
    }

## exports-with-reassigned-module-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {exports: {}};␊
      ␊
      (function (module, exports) {␊
      exports.foo = 'foo';␊
      module.exports = { replaced: true };␊
      exports.bar = 'bar';␊
      }(dep, dep.exports));␊
      ␊
      const dep$1 = dep.exports;␊
      ␊
      t.deepEqual(dep$1, { replaced: true });␊
      ␊
      module.exports = main;␊
      `,
    }

## expose-file-type-detection

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = require('./other.js');␊
      ␊
      t.is(other, 'foo');␊
      `,
      'other.js': `'use strict';␊
      ␊
      var other = 'foo';␊
      ␊
      module.exports = other;␊
      `,
    }

## external-imports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('foo');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      const foo = require$$0__default['default'];␊
      ␊
      var main = foo;␊
      ␊
      module.exports = main;␊
      `,
    }

## fallback-no-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable */␊
      var one = 1;␊
      ␊
      var two = 2;␊
      ␊
      var foo = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	one: one,␊
      	two: two␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(foo);␊
      ␊
      const foo$1 = require$$0;␊
      ␊
      t.is(foo$1.one, 1);␊
      t.is(foo$1.two, 2);␊
      ␊
      module.exports = main;␊
      `,
    }

## global-not-overwritten

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var encode = {};␊
      ␊
      (function (exports) {␊
      exports.encodeURIComponent = function () {␊
        return encodeURIComponent(this.str);␊
      };␊
      ␊
      // to ensure module is wrapped␊
      commonjsGlobal.foo = exports;␊
      }(encode));␊
      ␊
      /* eslint-disable */␊
      ␊
      const foo = {␊
        str: 'test string',␊
        encodeURIComponent: encode.encodeURIComponent␊
      };␊
      ␊
      var encoded = foo.encodeURIComponent();␊
      ␊
      exports.encoded = encoded;␊
      `,
    }

## global-var

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      /* eslint-disable */␊
      ␊
      function foo() {␊
        const global = {};␊
        global.modified = true;␊
        return global;␊
      }␊
      ␊
      const notGlobal = foo();␊
      t.truthy(notGlobal.modified);␊
      t.truthy(!commonjsGlobal.modified);␊
      ␊
      var main = {};␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-auto

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getDefaultExportFromNamespaceIfNotNamed (n) {␊
      	return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmDefault__namespace);␊
      ␊
      const foo = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      const foo$1 = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1,␊
      	'default': mixed␊
      });␊
      ␊
      var require$$5 = 'bar';␊
      ␊
      var none = /*#__PURE__*/Object.freeze({␊
      	__proto__: null␊
      });␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = named;␊
      const mixedExports = mixed$1;␊
      const defaultExport = require$$5;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, 'bar', 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-false

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const foo = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      var require$$3 = /*@__PURE__*/getAugmentedNamespace(named);␊
      ␊
      const foo$1 = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1,␊
      	'default': mixed␊
      });␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(mixed$1);␊
      ␊
      var _default = 'bar';␊
      ␊
      var _default$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': _default␊
      });␊
      ␊
      var require$$5 = /*@__PURE__*/getAugmentedNamespace(_default$1);␊
      ␊
      var none = /*#__PURE__*/Object.freeze({␊
      	__proto__: null␊
      });␊
      ␊
      var require$$6 = /*@__PURE__*/getAugmentedNamespace(none);␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = require$$3;␊
      const mixedExports = require$$4;␊
      const defaultExport = require$$5;␊
      const noExports = require$$6;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-function

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var dep_false_default_ = 'default';␊
      ␊
      var dep_false_default_$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep_false_default_␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(dep_false_default_$1);␊
      ␊
      var dep_false_mixed_ = 'default'; const named = 'named';␊
      ␊
      var dep_false_mixed_$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep_false_mixed_,␊
      	named: named␊
      });␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(dep_false_mixed_$1);␊
      ␊
      const named$1 = 'named';␊
      ␊
      var dep_false_named_ = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	named: named$1␊
      });␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(dep_false_named_);␊
      ␊
      var require$$3 = 'default';␊
      ␊
      var dep_auto_mixed_ = 'default'; const named$2 = 'named';␊
      ␊
      var dep_auto_mixed_$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep_auto_mixed_,␊
      	named: named$2␊
      });␊
      ␊
      const named$3 = 'named';␊
      ␊
      var dep_auto_named_ = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	named: named$3␊
      });␊
      ␊
      var require$$6 = 'default';␊
      ␊
      var require$$7 = 'default';␊
      ␊
      const named$4 = 'named';␊
      ␊
      var dep_preferred_named_ = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	named: named$4␊
      });␊
      ␊
      var require$$9 = 'default';␊
      ␊
      var require$$10 = 'default';␊
      ␊
      const falseDefault = require$$0;␊
      const falseMixed = require$$1;␊
      const falseNamed = require$$2;␊
      ␊
      const autoDefault = require$$3;␊
      const autoMixed = dep_auto_mixed_$1;␊
      const autoNamed = dep_auto_named_;␊
      ␊
      const preferredDefault = require$$6;␊
      const preferredMixed = require$$7;␊
      const preferredNamed = dep_preferred_named_;␊
      ␊
      const trueDefault = require$$9;␊
      const trueMixed = require$$10;␊
      ␊
      t.deepEqual(falseDefault, { default: 'default' }, 'false default');␊
      t.deepEqual(falseMixed, { default: 'default', named: 'named' }, 'false mixed');␊
      t.deepEqual(falseNamed, { named: 'named' }, 'false named');␊
      ␊
      t.deepEqual(autoDefault, 'default', 'auto default');␊
      t.deepEqual(autoMixed, { default: 'default', named: 'named' }, 'auto mixed');␊
      t.deepEqual(autoNamed, { named: 'named' }, 'auto named');␊
      ␊
      t.deepEqual(preferredDefault, 'default', 'preferred default');␊
      t.deepEqual(preferredMixed, 'default', 'preferred mixed');␊
      t.deepEqual(preferredNamed, { named: 'named' }, 'preferred named');␊
      ␊
      t.deepEqual(trueDefault, 'default', 'true default');␊
      t.deepEqual(trueMixed, 'default', 'true mixed');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-function-called-once

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = 'other.js';␊
      ␊
      var require$$1 = 'both.js';␊
      ␊
      const other = require$$0;␊
      const both = require$$1;␊
      ␊
      t.deepEqual(other, 'other.js', 'other other');␊
      t.deepEqual(both, 'both.js', 'other both');␊
      ␊
      var require$$0$1 = 'main.js';␊
      ␊
      const main$1 = require$$0$1;␊
      const both$1 = require$$1;␊
      ␊
      t.deepEqual(main$1, 'main.js', 'main main');␊
      t.deepEqual(both$1, 'both.js', 'main both');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-function-external

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var require$$1 = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getDefaultExportFromNamespaceIfNotNamed (n) {␊
      	return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;␊
      }␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmNamed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1__default['default'];␊
      const externalDefault = require$$2;␊
      ␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'named');␊
      t.deepEqual(externalMixed, 'bar', 'mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-namespace

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      const foo$1 = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1,␊
      	'default': mixed␊
      });␊
      ␊
      var _default = 'bar';␊
      ␊
      var _default$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': _default␊
      });␊
      ␊
      var none = /*#__PURE__*/Object.freeze({␊
      	__proto__: null␊
      });␊
      ␊
      const externalNamed = externalEsmNamed__namespace;␊
      const externalMixed = externalEsmMixed__namespace;␊
      const externalDefault = externalEsmDefault__namespace;␊
      ␊
      const namedExports = named;␊
      const mixedExports = mixed$1;␊
      const defaultExport = _default$1;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-preferred

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getDefaultExportFromNamespaceIfPresent (n) {␊
      	return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmDefault__namespace);␊
      ␊
      const foo = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      var require$$4 = 'bar';␊
      ␊
      var require$$5 = 'bar';␊
      ␊
      var none = /*#__PURE__*/Object.freeze({␊
      	__proto__: null␊
      });␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = named;␊
      const mixedExports = require$$4;␊
      const defaultExport = require$$5;␊
      const noExports = none;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, 'bar', 'mixed exports');␊
      t.deepEqual(defaultExport, 'bar', 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-true

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-esm-named');␊
      var require$$1 = require('external-esm-mixed');␊
      var require$$2 = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);␊
      var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);␊
      ␊
      var main = {};␊
      ␊
      var require$$3 = 'bar';␊
      ␊
      var require$$4 = 'bar';␊
      ␊
      const externalNamed = require$$0__default['default'];␊
      const externalMixed = require$$1__default['default'];␊
      const externalDefault = require$$2__default['default'];␊
      ␊
      const mixedExports = require$$3;␊
      const defaultExport = require$$4;␊
      ␊
      t.deepEqual(mixedExports, 'bar', 'mixed exports');␊
      t.deepEqual(defaultExport, 'bar', 'default export');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, 'bar', 'external mixed');␊
      t.deepEqual(externalDefault, 'bar', 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-require-returns-default-undefined

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      var externalEsmMixed = require('external-esm-mixed');␊
      var externalEsmDefault = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
      	if (e && e.__esModule) return e;␊
      	var n = Object.create(null);␊
      	if (e) {␊
      		Object.keys(e).forEach(function (k) {␊
      			if (k !== 'default') {␊
      				var d = Object.getOwnPropertyDescriptor(e, k);␊
      				Object.defineProperty(n, k, d.get ? d : {␊
      					enumerable: true,␊
      					get: function () {␊
      						return e[k];␊
      					}␊
      				});␊
      			}␊
      		});␊
      	}␊
      	n['default'] = e;␊
      	return Object.freeze(n);␊
      }␊
      ␊
      var externalEsmNamed__namespace = /*#__PURE__*/_interopNamespace(externalEsmNamed);␊
      var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespace(externalEsmMixed);␊
      var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespace(externalEsmDefault);␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊
      ␊
      var require$$1 = /*@__PURE__*/getAugmentedNamespace(externalEsmMixed__namespace);␊
      ␊
      var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊
      ␊
      const foo = 'foo';␊
      ␊
      var named = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      var require$$3 = /*@__PURE__*/getAugmentedNamespace(named);␊
      ␊
      const foo$1 = 'foo';␊
      var mixed = 'bar';␊
      ␊
      var mixed$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo$1,␊
      	'default': mixed␊
      });␊
      ␊
      var require$$4 = /*@__PURE__*/getAugmentedNamespace(mixed$1);␊
      ␊
      var _default = 'bar';␊
      ␊
      var _default$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': _default␊
      });␊
      ␊
      var require$$5 = /*@__PURE__*/getAugmentedNamespace(_default$1);␊
      ␊
      var none = /*#__PURE__*/Object.freeze({␊
      	__proto__: null␊
      });␊
      ␊
      var require$$6 = /*@__PURE__*/getAugmentedNamespace(none);␊
      ␊
      const externalNamed = require$$0;␊
      const externalMixed = require$$1;␊
      const externalDefault = require$$2;␊
      ␊
      const namedExports = require$$3;␊
      const mixedExports = require$$4;␊
      const defaultExport = require$$5;␊
      const noExports = require$$6;␊
      ␊
      t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊
      t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊
      t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊
      t.deepEqual(noExports, {}, 'no exports');␊
      t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊
      t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊
      t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊
      ␊
      module.exports = main;␊
      `,
    }

## import-esm-with-interop

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      /* eslint-disable import/no-mutable-exports */␊
      let foo = 'foo';␊
      let bar = 'bar';␊
      ␊
      function update(newFoo, newBar) {␊
        foo = newFoo;␊
        bar = newBar;␊
      }␊
      ␊
      var lib = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	get default () { return foo; },␊
      	get bar () { return bar; },␊
      	update: update␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib);␊
      ␊
      /* eslint-disable */␊
      ␊
      var lib$1 = require$$0;␊
      ␊
      function _interopDefault$1(e) {␊
        return e && e.__esModule ? e : { default: e };␊
      }␊
      ␊
      var lib__default = /*#__PURE__*/_interopDefault$1(lib$1);␊
      t.is(lib__default['default'], 'foo');␊
      t.is(lib$1.bar, 'bar');␊
      ␊
      lib$1.update('newFoo', 'newBar');␊
      t.is(lib__default['default'], 'newFoo');␊
      t.is(lib$1.bar, 'newBar');␊
      ␊
      module.exports = main;␊
      `,
    }

## index

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo = 42;␊
      ␊
      const foo$1 = foo;␊
      ␊
      t.is(foo$1, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## inline

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var multiply = function (a, b) {␊
        return a * b;␊
      };␊
      ␊
      var foo = 1;␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      var main = function () {␊
        return multiply(2, foo);␊
      };␊
      ␊
      module.exports = main;␊
      `,
    }

## interop-esmodule-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var other = {exports: {}};␊
      ␊
      (function (module, exports) {␊
      exports.default = 42;␊
      ␊
      addCompiledMarker(module.exports);␊
      ␊
      function addCompiledMarker(exports) {␊
        // eslint-disable-next-line no-param-reassign␊
        exports.__esModule = true;␊
      }␊
      }(other, other.exports));␊
      ␊
      var foo = /*@__PURE__*/getDefaultExportFromCjs(other.exports);␊
      ␊
      t.deepEqual(foo, 42);␊
      `,
    }

## interop-no-esmodule-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = {exports: {}};␊
      ␊
      (function (module) {␊
      addDefaultExport(module.exports);␊
      ␊
      function addDefaultExport(exports) {␊
        // eslint-disable-next-line no-param-reassign␊
        exports.default = 42;␊
      }␊
      }(other));␊
      ␊
      var foo = other.exports;␊
      ␊
      t.deepEqual(foo, { default: 42 });␊
      `,
    }

## interop-without-default-unwrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = {};␊
      ␊
      other.foo = '__esModule';␊
      ␊
      t.deepEqual(other, { foo: '__esModule' });␊
      `,
    }

## late-entry-dependency

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var other = require('./other.js');␊
      ␊
      var main = {};␊
      ␊
      const foo = other;␊
      ␊
      t.is(foo, 'foo');␊
      ␊
      module.exports = main;␊
      `,
      'other.js': `'use strict';␊
      ␊
      var other = 'foo';␊
      ␊
      module.exports = other;␊
      `,
    }

## leading-comment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /*␊
       * This comment could be really important and should not be removed␊
       */␊
      ␊
      var main = 'bar';␊
      ␊
      module.exports = main;␊
      `,
    }

## leading-comment-imports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('external-cjs-exports');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var main = {};␊
      ␊
      /*␊
       * This comment could be really important and should not be removed␊
       */␊
      ␊
      const externalExports = require$$0__default['default'];␊
      ␊
      t.is(externalExports.foo, 'foo');␊
      ␊
      module.exports = main;␊
      `,
    }

## leading-comment-wrapped

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      /*␊
       * This comment could be really important and should not be removed␊
       */␊
      ␊
      (function (exports) {␊
      ␊
      modifyExports(exports);␊
      ␊
      function modifyExports(exported) {␊
        // eslint-disable-next-line no-param-reassign␊
        exported.foo = 'bar';␊
      }␊
      }(main));␊
      ␊
      module.exports = main;␊
      `,
    }

## module_require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = 21;␊
      ␊
      const foo$1 = foo;␊
      ␊
      var main = foo$1 * 2;␊
      ␊
      module.exports = main;␊
      `,
    }

## multiple-define-compiled-esm

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = {};␊
      ␊
      Object.defineProperty(foo, '__esModule', { value: true });␊
      ␊
      Object.defineProperty(foo, '__esModule', { value: true });␊
      ␊
      var _default = foo.default = 'foo';␊
      ␊
      t.deepEqual(_default, 'foo');␊
      `,
    }

## named-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var a = 1;␊
      var b = 2;␊
      ␊
      t.is(a, 1);␊
      t.is(b, 2);␊
      `,
    }

## named-exports-conditional

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      if (typeof someUnknownGlobal !== 'undefined') {␊
        x.exports = { named: 'bar' };␊
      } else {␊
        x.exports = { named: 'foo' };␊
      }␊
      ␊
      t.is(x.exports.named, 'foo');␊
      `,
    }

## named-exports-dynamic

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      (function (module) {␊
      window.addExport = (key, value) => {␊
        module.exports[key] = value;␊
      };␊
      }(x));␊
      ␊
      t.is(x.exports.named, undefined);␊
      ␊
      window.addExport('named', 'foo');␊
      ␊
      t.is(x.exports.named, 'foo');␊
      `,
    }

## named-exports-object-define

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {exports: {}};␊
      ␊
      (function (module) {␊
      Object.defineProperty(module.exports, 'named', {␊
        enumerable: true,␊
        get: function get() {␊
          return 'foo';␊
        }␊
      });␊
      }(x));␊
      ␊
      t.is(x.exports.named, 'foo');␊
      `,
    }

## named-exports-reexport-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var _export = {};␊
      ␊
      _export.named = 2;␊
      ␊
      var reexport = _export;␊
      ␊
      t.is(reexport.named, 2);␊
      `,
    }

## named-exports-reexport-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var _export = {};␊
      ␊
      _export.named = 2;␊
      ␊
      const myModule = _export;␊
      ␊
      var named = myModule.named;␊
      ␊
      t.is(named, 2);␊
      `,
    }

## named-exports-unexported

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var x = {};␊
      ␊
      x.named = 2;␊
      ␊
      t.is(x.nonExisting, undefined);␊
      `,
    }

## nested-define-compiled-esm-unused

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var foo = {};␊
      ␊
      (function (exports) {␊
      ␊
      exports.default = 'foo';␊
      }(foo));␊
      ␊
      var foo$1 = /*@__PURE__*/getDefaultExportFromCjs(foo);␊
      ␊
      t.deepEqual(foo$1, { default: 'foo' });␊
      `,
    }

## nested-define-compiled-esm-used

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var foo = {};␊
      ␊
      (function (exports) {␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      {␊
        Object.defineProperty(exports, '__esModule', { value: true });␊
      }␊
      ␊
      exports.default = 'foo';␊
      }(foo));␊
      ␊
      var foo$1 = /*@__PURE__*/getDefaultExportFromCjs(foo);␊
      ␊
      t.deepEqual(foo$1, 'foo');␊
      `,
    }

## nested-named-export-assignments

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep1 = {};␊
      ␊
      dep1.foo = 'first';␊
      ␊
      reassignSomeExports();␊
      reassignSomeMoreExports();␊
      ␊
      function reassignSomeExports() {␊
        dep1.foo = 'second';␊
        dep1.bar = 'first';␊
      }␊
      ␊
      function reassignSomeMoreExports() {␊
        dep1.bar = 'second';␊
      }␊
      ␊
      var bar;␊
      var foo = 'first';␊
      ␊
      reassignSomeExports$1();␊
      reassignSomeMoreExports$1();␊
      ␊
      function reassignSomeExports$1() {␊
        foo = 'second';␊
        bar = 'first';␊
      }␊
      ␊
      function reassignSomeMoreExports$1() {␊
        bar = 'second';␊
      }␊
      ␊
      t.is(dep1.foo, 'second');␊
      t.is(dep1.bar, 'second');␊
      t.is(foo, 'second');␊
      t.is(bar, 'second');␊
      `,
    }

## no-default-export-live-binding

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var dep1 = {␊
        foo: 'foo',␊
        update: () => (dep1 = { foo: 'bar' })␊
      };␊
      ␊
      var dep1$1 = dep1;␊
      ␊
      var dep2 = {exports: {}};␊
      ␊
      dep2.exports.foo = 'foo';␊
      dep2.exports.update = () => (dep2.exports = { foo: 'bar' });␊
      ␊
      var dep2$1 = dep2.exports;␊
      ␊
      var dep3 = {exports: {}};␊
      ␊
      (function (module, exports) {␊
      exports.foo = 'foo';␊
      module.exports.update = () => (module.exports = { foo: 'bar' });␊
      }(dep3, dep3.exports));␊
      ␊
      var dep3$1 = dep3.exports;␊
      ␊
      t.is(dep1$1.foo, 'foo', 'dep1');␊
      dep1$1.update();␊
      t.is(dep1$1.foo, 'foo', 'dep1 updated');␊
      ␊
      t.is(dep2$1.foo, 'foo', 'dep2');␊
      dep2$1.update();␊
      t.is(dep2$1.foo, 'foo', 'dep2 updated');␊
      ␊
      t.is(dep3$1.foo, 'foo', 'dep3');␊
      dep3$1.update();␊
      t.is(dep3$1.foo, 'foo', 'dep3 updated');␊
      `,
    }

## no-exports-entry

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = 42;␊
      ␊
      const dep$1 = dep;␊
      ␊
      t.is(dep$1, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## no-side-effects

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      dep.foo = 'bar';␊
      ␊
      const dep$1 = dep;␊
      ␊
      t.is(dep$1.foo, 'bar');␊
      ␊
      module.exports = main;␊
      `,
    }

## only-nested-module-exports-reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep1 = {exports: {}};␊
      ␊
      if (reassignFirstModuleExports) {␊
        dep1.exports = 'reassigned';␊
      }␊
      ␊
      var dep2 = {exports: {}};␊
      ␊
      if (reassignSecondModuleExports) {␊
        dep2.exports = 'reassigned';␊
      }␊
      ␊
      const dep1$1 = dep1.exports;␊
      const dep2$1 = dep2.exports;␊
      ␊
      t.is(dep1$1, 'reassigned');␊
      t.deepEqual(dep2$1, {});␊
      ␊
      module.exports = main;␊
      `,
    }

## ordering

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var shared = {␊
        fooLoaded: false␊
      };␊
      ␊
      const shared$1 = shared;␊
      ␊
      // Mutate the shared module␊
      shared$1.fooLoaded = true;␊
      ␊
      const shared$2 = shared;␊
      ␊
      var bar = shared$2.fooLoaded;␊
      ␊
      const fooLoaded = bar;␊
      ␊
      t.truthy(fooLoaded);␊
      ␊
      module.exports = main;␊
      `,
    }

## pass-require-to-node-resolve

> Snapshot 1

    {
      'bar-imported-49e0dbcf.js': `'use strict';␊
      ␊
      var barImported = 'imported';␊
      ␊
      exports.default = barImported;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var foo = 'imported';␊
      ␊
      var requiring = {};␊
      ␊
      var fooRequired = 'required';␊
      ␊
      requiring.foo = fooRequired;␊
      ␊
      requiring.barPromise = Promise.resolve().then(function () { return require('./bar-imported-49e0dbcf.js'); });␊
      ␊
      t.is(foo, 'imported');␊
      t.is(requiring.foo, 'required');␊
      ␊
      var main = Promise.all([Promise.resolve().then(function () { return require('./bar-imported-49e0dbcf.js'); }), requiring.barPromise]);␊
      ␊
      module.exports = main;␊
      `,
    }

## react-apollo

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsBar = {};␊
      ␊
      /* eslint-disable no-underscore-dangle */␊
      ␊
      function Bar() {␊
        this.x = 42;␊
      }␊
      ␊
      commonjsBar.__esModule = true;␊
      commonjsBar.default = Bar;␊
      ␊
      /* eslint-disable no-underscore-dangle */␊
      ␊
      const Bar$1 = commonjsBar;␊
      var Bar_1 = Bar$1.default;␊
      ␊
      t.is(new Bar_1().x, 42);␊
      `,
    }

## reassign-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var identifier = {};␊
      ␊
      (function (exports) {␊
      exports = 'foo';␊
      t.is(exports, 'foo');␊
      }(identifier));␊
      ␊
      var property = {};␊
      ␊
      (function (exports) {␊
      ({ foo: exports } = { foo: 'foo' });␊
      t.is(exports, 'foo');␊
      }(property));␊
      ␊
      var arrayPattern = {};␊
      ␊
      (function (exports) {␊
      [exports] = ['foo'];␊
      t.is(exports, 'foo');␊
      }(arrayPattern));␊
      ␊
      var assignmentPattern = {};␊
      ␊
      (function (exports) {␊
      ({ exports = 'foo' } = {});␊
      t.is(exports, 'foo');␊
      }(assignmentPattern));␊
      ␊
      const identifier$1 = identifier;␊
      const property$1 = property;␊
      const arrayPattern$1 = arrayPattern;␊
      const assignmentPattern$1 = assignmentPattern;␊
      ␊
      t.deepEqual(identifier$1, {});␊
      t.deepEqual(property$1, {});␊
      t.deepEqual(arrayPattern$1, {});␊
      t.deepEqual(assignmentPattern$1, {});␊
      ␊
      module.exports = main;␊
      `,
    }

## reassign-module

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var identifier = {exports: {}};␊
      ␊
      (function (module) {␊
      // eslint-disable-next-line no-global-assign␊
      module = 'foo';␊
      t.is(module, 'foo');␊
      }(identifier));␊
      ␊
      var property = {exports: {}};␊
      ␊
      (function (module) {␊
      // eslint-disable-next-line no-global-assign␊
      ({ foo: module } = { foo: 'foo' });␊
      t.is(module, 'foo');␊
      }(property));␊
      ␊
      var arrayPattern = {exports: {}};␊
      ␊
      (function (module) {␊
      // eslint-disable-next-line no-global-assign␊
      [module] = ['foo'];␊
      t.is(module, 'foo');␊
      }(arrayPattern));␊
      ␊
      var assignmentPattern = {exports: {}};␊
      ␊
      (function (module) {␊
      // eslint-disable-next-line no-global-assign␊
      ({ module = 'foo' } = {});␊
      t.is(module, 'foo');␊
      }(assignmentPattern));␊
      ␊
      const identifier$1 = identifier.exports;␊
      const property$1 = property.exports;␊
      const arrayPattern$1 = arrayPattern.exports;␊
      const assignmentPattern$1 = assignmentPattern.exports;␊
      ␊
      t.deepEqual(identifier$1, {});␊
      t.deepEqual(property$1, {});␊
      t.deepEqual(arrayPattern$1, {});␊
      t.deepEqual(assignmentPattern$1, {});␊
      ␊
      module.exports = main;␊
      `,
    }

## reassigned-module-exports-object

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {exports: {}};␊
      ␊
      const exported = {};␊
      dep.exports = exported;␊
      dep.exports.foo = 'foo';␊
      ␊
      t.deepEqual(exported, { foo: 'foo' });␊
      ␊
      const dep$1 = dep.exports;␊
      ␊
      t.deepEqual(dep$1, { foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      function foo() {}␊
      foo.something = false;␊
      ␊
      var foo_1 = foo;␊
      ␊
      let foo$1 = foo_1;␊
      ␊
      if (!foo$1.something) {␊
        foo$1 = function somethingElse() {};␊
        foo$1.something = true;␊
      }␊
      ␊
      t.truthy(foo$1.something);␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-named-namespace

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      var other = 'bar';␊
      ␊
      var other$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': other␊
      });␊
      ␊
      var dep = 'default';␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep,␊
      	ns: other$1␊
      });␊
      ␊
      const dep$2 = dep$1;␊
      ␊
      t.deepEqual(dep$2, { default: 'default', ns: { default: 'bar', foo: 'foo' } });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-namespace-and-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      ␊
      var dep = 'default';␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': dep,␊
      	foo: foo␊
      });␊
      ␊
      const dep$2 = dep$1;␊
      ␊
      t.deepEqual(dep$2, { default: 'default', foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-namespace-named-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      var other = 'bar';␊
      ␊
      var other$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo,␊
      	'default': other␊
      });␊
      ␊
      const dep = other$1;␊
      ␊
      t.deepEqual(dep, { default: 'bar', foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-esm-with-namespace-prefer-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      const foo = 'foo';␊
      ␊
      var dep = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	foo: foo␊
      });␊
      ␊
      const dep$1 = dep;␊
      ␊
      t.deepEqual(dep$1, { foo: 'foo' });␊
      ␊
      module.exports = main;␊
      `,
    }

## require-snapshotting

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {␊
        foo: 'foo',␊
        update: () => (dep = { foo: 'bar' })␊
      };␊
      ␊
      const dep$1 = dep;␊
      ␊
      t.is(dep$1.foo, 'foo');␊
      ␊
      dep$1.update();␊
      ␊
      t.is(dep$1.foo, 'foo');␊
      t.is(dep.foo, 'bar');␊
      ␊
      module.exports = main;␊
      `,
    }

## resolve-is-cjs-extension

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      const result = 'second';␊
      ␊
      var second = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	result: result␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(second);␊
      ␊
      t.is(require$$0.result, 'second');␊
      ␊
      module.exports = main;␊
      `,
    }

## resolve-is-cjs-filtered

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var main = {};␊
      ␊
      const result = 'second';␊
      ␊
      var second = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	result: result␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(second);␊
      ␊
      t.is(require$$0.result, 'second');␊
      ␊
      module.exports = main;␊
      `,
    }

## shadowed-import

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo = 'foo';␊
      ␊
      const foo$1 = foo;␊
      ␊
      t.is(foo$1, 'foo');␊
      ␊
      {␊
        // eslint-disable-next-line no-shadow␊
        const foo$1 = 'wrong';␊
        // eslint-disable-next-line global-require␊
        const bar = foo;␊
        t.is(foo$1, 'wrong');␊
        t.is(bar, 'foo');␊
      }␊
      ␊
      module.exports = main;␊
      `,
    }

## shadowing

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function foo(require) {␊
        require('not-an-actual-require-statement');␊
      }␊
      ␊
      let result;␊
      ␊
      foo((msg) => {␊
        result = msg;␊
      });␊
      ␊
      t.is(result, 'not-an-actual-require-statement');␊
      `,
    }

## skips-dead-branches

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      commonjsGlobal.b = 2;␊
      var b = 'b';␊
      ␊
      /* eslint-disable */␊
      ␊
      var main = b ;␊
      ␊
      module.exports = main;␊
      `,
    }

## this

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      var main = {};␊
      ␊
      var foo = function augmentThis() {␊
        this.x = 'x';␊
      };␊
      ␊
      commonjsGlobal.y = 'y';␊
      ␊
      const foo$1 = foo;␊
      ␊
      const obj = {};␊
      foo$1.call(obj);␊
      ␊
      t.is(obj.x, 'x');␊
      t.is(commonjsGlobal.y, 'y');␊
      ␊
      module.exports = main;␊
      `,
    }

## top-level-and-nested-module-exports-reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep1 = 'original';␊
      if (reassignFirstModuleExports) {␊
        dep1 = 'reassigned';␊
      }␊
      ␊
      var dep2 = 'original';␊
      if (reassignSecondModuleExports) {␊
        dep2 = 'reassigned';␊
      }␊
      ␊
      if (reassignFirstModuleExports) {␊
        dep3 = 'reassigned';␊
      }␊
      var dep3 = 'final';␊
      ␊
      if (reassignSecondModuleExports) {␊
        dep4 = 'reassigned';␊
      }␊
      var dep4 = 'final';␊
      ␊
      const dep1$1 = dep1;␊
      const dep2$1 = dep2;␊
      const dep3$1 = dep3;␊
      const dep4$1 = dep4;␊
      ␊
      t.is(dep1$1, 'reassigned');␊
      t.is(dep2$1, 'original');␊
      t.is(dep3$1, 'final');␊
      t.is(dep4$1, 'final');␊
      ␊
      module.exports = main;␊
      `,
    }

## toplevel-return

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /* eslint-disable */␊
      ␊
      var main = 'foo';␊
      ␊
      module.exports = main;␊
      `,
    }

## toplevel-return-complex

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var foo = {exports: {}};␊
      ␊
      (function (module) {␊
      ␊
      module.exports = 'bar';␊
      {␊
        return;␊
      }␊
      }(foo));␊
      ␊
      const foo$1 = foo.exports;␊
      ␊
      var main = foo$1;␊
      ␊
      module.exports = main;␊
      `,
    }

## trailing-slash

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var foo = 42;␊
      ␊
      const foo$1 = foo;␊
      ␊
      t.is(foo$1, 42);␊
      ␊
      module.exports = main;␊
      `,
    }

## transform-mixed-modules

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getAugmentedNamespace(n) {␊
      	if (n.__esModule) return n;␊
      	var a = Object.defineProperty({}, '__esModule', {value: true});␊
      	Object.keys(n).forEach(function (k) {␊
      		var d = Object.getOwnPropertyDescriptor(n, k);␊
      		Object.defineProperty(a, k, d.get ? d : {␊
      			enumerable: true,␊
      			get: function () {␊
      				return n[k];␊
      			}␊
      		});␊
      	});␊
      	return a;␊
      }␊
      ␊
      var other = 'other';␊
      ␊
      const other$1 = other;␊
      ␊
      var dep = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	other: other$1␊
      });␊
      ␊
      var require$$0 = /*@__PURE__*/getAugmentedNamespace(dep);␊
      ␊
      const dep$1 = require$$0;␊
      ␊
      t.is(other$1, 'other');␊
      t.deepEqual(dep$1, { other: 'other' });␊
      `,
    }

## transpiled-esm-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-default');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var external__default = /*#__PURE__*/_interopDefaultLegacy(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var _default = dep.default = 'default';␊
      ␊
      t.is(_default, 'default');␊
      t.is(external__default['default'], 'bar');␊
      `,
    }

## transpiled-esm-entry-default

> Snapshot 1

    {
      'entry-d637a688.js': `'use strict';␊
      ␊
      var entry = {};␊
      ␊
      Object.defineProperty(entry, '__esModule', { value: true });␊
      var _default = entry.default = 'default';␊
      ␊
      var entry$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), entry, {␊
      	'default': _default␊
      }));␊
      ␊
      exports._default = _default;␊
      exports.entry = entry$1;␊
      `,
      'entry.js': `'use strict';␊
      ␊
      var entry = require('./entry-d637a688.js');␊
      ␊
      ␊
      ␊
      module.exports = entry._default;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var entry = require('./entry-d637a688.js');␊
      ␊
      t.deepEqual(entry.entry, { default: 'default' });␊
      `,
    }

## transpiled-esm-entry-mixed

> Snapshot 1

    {
      'entry-04442d28.js': `'use strict';␊
      ␊
      var entry = {};␊
      ␊
      Object.defineProperty(entry, '__esModule', { value: true });␊
      var _default = entry.default = 'default';␊
      var named = entry.named = 'named';␊
      ␊
      var entry$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), entry, {␊
      	named: named,␊
      	'default': _default␊
      }));␊
      ␊
      exports._default = _default;␊
      exports.entry = entry$1;␊
      exports.named = named;␊
      `,
      'entry.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var entry = require('./entry-04442d28.js');␊
      ␊
      ␊
      ␊
      exports.default = entry._default;␊
      exports.named = entry.named;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var entry = require('./entry-04442d28.js');␊
      ␊
      t.deepEqual(entry.entry, { default: 'default', named: 'named' });␊
      `,
    }

## transpiled-esm-entry-named

> Snapshot 1

    {
      'entry.js': `'use strict';␊
      ␊
      Object.defineProperty(exports, '__esModule', { value: true });␊
      ␊
      var entry = require('./generated-entry.js');␊
      ␊
      ␊
      ␊
      exports.default = entry.entry$1;␊
      exports.named = entry.named;␊
      `,
      'generated-entry.js': `'use strict';␊
      ␊
      var entry = {};␊
      ␊
      Object.defineProperty(entry, '__esModule', { value: true });␊
      var named = entry.named = 'named';␊
      ␊
      var entry$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), entry, {␊
      	named: named,␊
      	'default': entry␊
      }));␊
      ␊
      exports.entry = entry$1;␊
      exports.entry$1 = entry;␊
      exports.named = named;␊
      `,
      'main.js': `'use strict';␊
      ␊
      var entry = require('./generated-entry.js');␊
      ␊
      t.deepEqual(entry.entry, {␊
        default: {␊
          named: 'named'␊
        },␊
        named: 'named'␊
      });␊
      `,
    }

## transpiled-esm-mixed

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-mixed');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var external__default = /*#__PURE__*/_interopDefaultLegacy(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var named = dep.named = 'named';␊
      var _default = dep.default = 'default';␊
      ␊
      t.is(_default, 'default');␊
      t.is(named, 'named');␊
      t.is(external__default['default'], 'bar');␊
      t.is(external.foo, 'foo');␊
      `,
    }

## transpiled-esm-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var externalEsmNamed = require('external-esm-named');␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var named = dep.named = 'named';␊
      ␊
      t.is(named, 'named');␊
      t.is(externalEsmNamed.foo, 'foo');␊
      `,
    }

## transpiled-esm-namespace-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-default');␊
      ␊
      function _interopNamespace(e) {␊
        if (e && e.__esModule) return e;␊
        var n = Object.create(null);␊
        if (e) {␊
          Object.keys(e).forEach(function (k) {␊
            if (k !== 'default') {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () {␊
                  return e[k];␊
                }␊
              });␊
            }␊
          });␊
        }␊
        n['default'] = e;␊
        return Object.freeze(n);␊
      }␊
      ␊
      var external__namespace = /*#__PURE__*/_interopNamespace(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var _default = dep.default = 'default';␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), dep, {␊
        'default': _default␊
      }));␊
      ␊
      t.deepEqual(dep$1, {␊
        default: 'default'␊
      });␊
      ␊
      t.deepEqual(external__namespace, {␊
        default: 'bar'␊
      });␊
      `,
    }

## transpiled-esm-namespace-mixed

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-mixed');␊
      ␊
      function _interopNamespace(e) {␊
        if (e && e.__esModule) return e;␊
        var n = Object.create(null);␊
        if (e) {␊
          Object.keys(e).forEach(function (k) {␊
            if (k !== 'default') {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () {␊
                  return e[k];␊
                }␊
              });␊
            }␊
          });␊
        }␊
        n['default'] = e;␊
        return Object.freeze(n);␊
      }␊
      ␊
      var external__namespace = /*#__PURE__*/_interopNamespace(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var named = dep.named = 'named';␊
      var _default = dep.default = 'default';␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), dep, {␊
        named: named,␊
        'default': _default␊
      }));␊
      ␊
      t.deepEqual(dep$1, {␊
        default: 'default',␊
        named: 'named'␊
      });␊
      ␊
      t.deepEqual(external__namespace, {␊
        default: 'bar',␊
        foo: 'foo'␊
      });␊
      `,
    }

## transpiled-esm-namespace-named

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var external = require('external-esm-named');␊
      ␊
      function _interopNamespace(e) {␊
        if (e && e.__esModule) return e;␊
        var n = Object.create(null);␊
        if (e) {␊
          Object.keys(e).forEach(function (k) {␊
            if (k !== 'default') {␊
              var d = Object.getOwnPropertyDescriptor(e, k);␊
              Object.defineProperty(n, k, d.get ? d : {␊
                enumerable: true,␊
                get: function () {␊
                  return e[k];␊
                }␊
              });␊
            }␊
          });␊
        }␊
        n['default'] = e;␊
        return Object.freeze(n);␊
      }␊
      ␊
      var external__namespace = /*#__PURE__*/_interopNamespace(external);␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      var named = dep.named = 'named';␊
      ␊
      var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), dep, {␊
        named: named,␊
        'default': dep␊
      }));␊
      ␊
      t.deepEqual(dep$1, {␊
        default: {␊
          named: 'named'␊
        },␊
        named: 'named'␊
      });␊
      ␊
      t.deepEqual(external__namespace, {␊
        foo: 'foo'␊
      });␊
      `,
    }

## transpiled-esm-nested-module-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var dep = {exports: {}};␊
      ␊
      Object.defineProperty(dep.exports, '__esModule', { value: true });␊
      ␊
      if (globalValue) {␊
        dep.exports = 'first';␊
      } else {␊
        dep.exports = 'second';␊
      }␊
      ␊
      var dep$1 = /*@__PURE__*/getDefaultExportFromCjs(dep.exports);␊
      ␊
      t.is(dep$1, 'first');␊
      `,
    }

## transpiled-esm-nested-module-exports2

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function getDefaultExportFromCjs (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      var dep = {exports: {}};␊
      ␊
      if (globalValue) {␊
        dep.exports = { default: 'first' };␊
      } else {␊
        dep.exports = { default: 'second' };␊
      }␊
      ␊
      Object.defineProperty(dep.exports, '__esModule', { value: true });␊
      ␊
      var dep$1 = /*@__PURE__*/getDefaultExportFromCjs(dep.exports);␊
      ␊
      t.is(dep$1, 'first');␊
      `,
    }

## transpiled-esm-required

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      dep.named = 'named';␊
      dep.default = 'default';␊
      ␊
      const dep$1 = dep;␊
      ␊
      t.deepEqual(dep$1, {␊
        default: 'default',␊
        named: 'named'␊
      });␊
      ␊
      // eslint-disable-next-line no-prototype-builtins␊
      t.is(dep$1.hasOwnProperty('named'), true);␊
      ␊
      module.exports = main;␊
      `,
    }

## transpiled-esm-transpiled-importer

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var main = {};␊
      ␊
      var dep = {};␊
      ␊
      Object.defineProperty(dep, '__esModule', { value: true });␊
      dep.default = 'default';␊
      ␊
      const dep$1 = dep;␊
      ␊
      function _interopDefault$1(e) {␊
        return e && e.__esModule ? e : { default: e };␊
      }␊
      ␊
      t.is(dep$1.__esModule, true);␊
      const dep__default = /* #__PURE__*/ _interopDefault$1(dep$1);␊
      t.is(dep__default.default, 'default');␊
      ␊
      module.exports = main;␊
      `,
    }

## try-catch

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        require('uninstalled-external-module');␊
      } catch (ignored) {␊
        /* ignore */␊
      }␊
      `,
    }

## try-catch-ids-array

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        require('uninstalled-external-module');␊
      } catch (ignored) {␊
        /* ignore */␊
      }␊
      `,
    }

## try-catch-ids-function

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /* eslint-disable global-require */␊
      ␊
      try {␊
        require('uninstalled-external-module');␊
      } catch (ignored) {␊
        /* ignore */␊
      }␊
      `,
    }

## typeof-module-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire (path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      var foo = {exports: {}};␊
      ␊
      if (typeof commonjsRequire === 'function' && commonjsRequire) {␊
        foo.exports = 1;␊
      } else {␊
        foo.exports = 2;␊
      }␊
      ␊
      var foo$1 = foo.exports;␊
      ␊
      t.is(foo$1, 1);␊
      `,
    }

## typeof-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function commonjsRequire (path) {␊
      	throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊
      }␊
      ␊
      var foo = {exports: {}};␊
      ␊
      if (typeof commonjsRequire === 'function' && commonjsRequire) {␊
        foo.exports = 1;␊
      } else {␊
        foo.exports = 2;␊
      }␊
      ␊
      var foo$1 = foo.exports;␊
      ␊
      t.is(foo$1, 1);␊
      `,
    }

## unresolved-dependencies

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var require$$0 = require('path');␊
      ␊
      function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }␊
      ␊
      var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);␊
      ␊
      var main = {};␊
      ␊
      const path = require$$0__default['default'];␊
      ␊
      t.is(typeof path.resolve, 'function');␊
      ␊
      module.exports = main;␊
      `,
    }
