# Snapshot report for `test/function.js`

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

Generated by [AVA](https://ava.li).

## \_\_esModule

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      var answer = createCommonjsModule(function (module, exports) {␊
      /* eslint-disable no-underscore-dangle */␊
      exports.__esModule = true;␊
      exports.answer = 42;␊
      });␊
      ␊
      var answer$1 = unwrapExports(answer);␊
      var answer_1 = answer.answer;␊
      ␊
      var x = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	'default': answer$1,␊
      	__moduleExports: answer,␊
      	answer: answer_1␊
      });␊
      ␊
      t.truthy('answer' in x);␊
      t.truthy('default' in x);␊
      t.truthy(!('__esModule' in x));␊
      `,
    }

## assign-properties-to-default-export

> Snapshot 1

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

## assumed-globals

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      var document_1 = createCommonjsModule(function (module) {␊
      /* eslint-disable */␊
      if (typeof document !== 'undefined') {␊
        module.exports = document;␊
      } else {␊
        module.exports = { fake: true };␊
      }␊
      });␊
      var document_2 = document_1.fake;␊
      ␊
      t.deepEqual(document_1, { 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;␊
      ␊
      var main = foo * 2;␊
      ␊
      module.exports = main;␊
      `,
    }

## dash-name

> Snapshot 1

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

## deconflict-export-and-local

> Snapshot 1

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

## dot

> Snapshot 1

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

## duplicate-default-exports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      const x = {};␊
      ␊
      var x_1 = x;␊
      var _default = x;␊
      x_1.default = _default;␊
      ␊
      t.is(x_1.default, x_1);␊
      `,
    }

## duplicate-default-exports-b

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      const x = {};␊
      ␊
      var x_1 = x;␊
      var _default = 42;␊
      x_1.default = _default;␊
      ␊
      t.deepEqual(x_1, { default: 42 });␊
      `,
    }

## duplicate-default-exports-c

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      var Foo = 1;␊
      var _var = 'VAR';␊
      var _default = {␊
        Foo: 2,␊
        default: 3␊
      };␊
      ␊
      var exports$1 = {␊
      	Foo: Foo,␊
      	var: _var,␊
      	default: _default␊
      };␊
      ␊
      /* 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-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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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');␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/sub/node_modules/module/direct.js", function (module, exports) {␊
        module.exports = 'direct';␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/sub/node_modules/module/nested/nested.js", function (module, exports) {␊
        module.exports = 'nested';␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/node_modules/parent-module/parent.js", function (module, exports) {␊
        module.exports = 'parent';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      function takeModule(name) {␊
        return commonjsRequire(name,"/$$rollup_base$$/fixtures/function/dynamic-require-absolute-import/sub");␊
      }␊
      ␊
      var moduleDirect = takeModule('module/direct');␊
      var moduleNested = takeModule('module/nested/nested');␊
      var parentModule = takeModule('parent-module/parent');␊
      ␊
      var submodule = {␊
      	moduleDirect: moduleDirect,␊
      	moduleNested: moduleNested,␊
      	parentModule: parentModule␊
      };␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      t.deepEqual(submodule, {␊
        moduleDirect: 'direct',␊
        moduleNested: 'nested',␊
        parentModule: 'parent'␊
      });␊
      `,
    }

## dynamic-require-absolute-paths

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }␊
      ␊
      var path = _interopDefault(require('path'));␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-absolute-paths/submodule.js", function (module, exports) {␊
        module.exports = 'submodule';␊
      ␊
      });␊
      ␊
      /* eslint-disable import/no-dynamic-require, global-require */␊
      ␊
      ␊
      ␊
      const basePath = `${process.cwd()}/fixtures/function/dynamic-require-absolute-paths`;␊
      ␊
      t.is(commonjsRequire(path.resolve(`${basePath}/submodule.js`),"/$$rollup_base$$/fixtures/function/dynamic-require-absolute-paths"), 'submodule');␊
      `,
    }

## dynamic-require-code-splitting

> Snapshot 1

    {
      'lib2-e9990dfe.js': `'use strict';␊
      ␊
      var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊
      ␊
      function unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-code-splitting/target1.js", function (module, exports) {␊
        module.exports = '1';␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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('./lib2-e9990dfe.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('./lib2-e9990dfe.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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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');␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-globs/submodule1.js", function (module, exports) {␊
        module.exports = 'submodule1';␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-globs/submodule2.js", function (module, exports) {␊
        module.exports = 'submodule2';␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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');␊
      ␊
      let hasThrown = false;␊
      try {␊
        takeModule('extramodule2.js');␊
      } catch (error) {␊
        t.truthy(/Cannot find module '\\.\\/extramodule2\\.js'/.test(error.message));␊
        hasThrown = true;␊
      }␊
      t.truthy(hasThrown);␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-instances/direct/index.js", function (module, exports) {␊
        module.exports = { name: 'direct', value: null };␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-instances/package/main.js", function (module, exports) {␊
        module.exorts = { name: 'package', value: null };␊
      ␊
      });␊
      ␊
      const { commonjsRegister: commonjsRegister$1 } = _commonjsHelpers;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-instances/direct", function (module, exports) {␊
        module.exports = commonjsRequire("/$$rollup_base$$/fixtures/function/dynamic-require-instances/direct/index.js", null);␊
      });␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-instances/package", function (module, exports) {␊
        module.exports = commonjsRequire("/$$rollup_base$$/fixtures/function/dynamic-require-instances/package/main.js", null);␊
      });␊
      ␊
      /* 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');␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      var value = "present";␊
      var dynamic = {␊
      	value: value␊
      };␊
      ␊
      var dynamic$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	value: value,␊
      	'default': dynamic␊
      });␊
      ␊
      var require$$1 = getCjsExportFromNamespace(dynamic$1);␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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' });␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      var entry = 'same-directory';␊
      ␊
      var entry$1 = 'sub';␊
      ␊
      var entry$2 = 'custom-module';␊
      ␊
      const { commonjsRegister: commonjsRegister$1 } = _commonjsHelpers;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-package", function (module, exports) {␊
        module.exports = entry;␊
      });␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-package/sub", function (module, exports) {␊
        module.exports = entry$1;␊
      });␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-package/node_modules/custom-module", function (module, exports) {␊
        module.exports = entry$2;␊
      });␊
      ␊
      /* 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' });␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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 _package = {␊
      	main: main␊
      };␊
      ␊
      var _package$1 = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	main: main,␊
      	'default': _package␊
      });␊
      ␊
      var require$$1 = getCjsExportFromNamespace(_package$1);␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module/package.json", function (module, exports) {␊
        module.exports = require$$1;␊
      });␊
      ␊
      const { commonjsRegister: commonjsRegister$1 } = _commonjsHelpers;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module", function (module, exports) {␊
        module.exports = commonjsRequire("/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/node_modules/custom-module/entry.js", null);␊
      });␊
      ␊
      t.is(commonjsRequire("custom-module", "/$$rollup_base$$/fixtures/function/dynamic-require-package-sub/sub"), 'custom-module');␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$rollup_base$$/fixtures/function/dynamic-require-relative-paths/sub/submodule.js", function (module, exports) {␊
        module.exports = 'submodule';␊
      ␊
      });␊
      ␊
      _commonjsHelpers.commonjsRegister("/$$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');␊
      `,
    }

## 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 unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      function commonjsRegister (path, loader) {␊
      	DYNAMIC_REQUIRE_LOADERS[path] = loader;␊
      }␊
      ␊
      const DYNAMIC_REQUIRE_LOADERS = Object.create(null);␊
      const DYNAMIC_REQUIRE_CACHE = 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 commonjsRequire (path, originalModuleDir) {␊
      	const shouldTryNodeModules = isPossibleNodeModulesPath(path);␊
      	path = normalize(path);␊
      	let relPath;␊
      	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));␊
      		}␊
      		for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {␊
      			const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];␊
      			let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      			if (cachedModule) return cachedModule.exports;␊
      			const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];␊
      			if (loader) {␊
      				DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {␊
      					id: resolvedPath,␊
      					filename: resolvedPath,␊
      					exports: {},␊
      					parent: DEFAULT_PARENT_MODULE,␊
      					loaded: false,␊
      					children: [],␊
      					paths: []␊
      				};␊
      				try {␊
      					loader.call(commonjsGlobal, cachedModule, cachedModule.exports);␊
      				} catch (error) {␊
      					delete DYNAMIC_REQUIRE_CACHE[resolvedPath];␊
      					throw error;␊
      				}␊
      				cachedModule.loaded = true;␊
      				return cachedModule.exports;␊
      			}		}␊
      		if (!shouldTryNodeModules) break;␊
      		const nextDir = normalize(originalModuleDir + '/..');␊
      		if (nextDir === originalModuleDir) break;␊
      		originalModuleDir = nextDir;␊
      	}␊
      	return require(path);␊
      }␊
      ␊
      commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;␊
      ␊
      var _commonjsHelpers = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	commonjsGlobal: commonjsGlobal,␊
      	unwrapExports: unwrapExports,␊
      	createCommonjsModule: createCommonjsModule,␊
      	getCjsExportFromNamespace: getCjsExportFromNamespace,␊
      	commonjsRegister: commonjsRegister,␊
      	commonjsRequire: commonjsRequire␊
      });␊
      ␊
      var dynamicRequireResolveIndex = 'same-directory';␊
      ␊
      var sub = 'sub';␊
      ␊
      var customModule = 'custom-module';␊
      ␊
      const { commonjsRegister: commonjsRegister$1 } = _commonjsHelpers;␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index", function (module, exports) {␊
        module.exports = dynamicRequireResolveIndex;␊
      });␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/sub", function (module, exports) {␊
        module.exports = sub;␊
      });␊
      commonjsRegister$1("/$$rollup_base$$/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module", function (module, exports) {␊
        module.exports = customModule;␊
      });␊
      ␊
      /* 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$1 = {␊
        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$1, { parent: 'same-directory', customModule: 'custom-module' });␊
      `,
    }

## export-default-from

> Snapshot 1

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

## exports

> Snapshot 1

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

## external-imports

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }␊
      ␊
      var foo = _interopDefault(require('foo'));␊
      ␊
      var main = foo;␊
      ␊
      module.exports = main;␊
      `,
    }

## fallback-no-default

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      /* eslint-disable */␊
      var one = 1;␊
      ␊
      var two = 2;␊
      ␊
      var foo = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	one: one,␊
      	two: two␊
      });␊
      ␊
      t.is(foo.one, 1);␊
      t.is(foo.two, 2);␊
      `,
    }

## 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 : {};␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      var encode = createCommonjsModule(function (module, exports) {␊
      exports.encodeURIComponent = function() {␊
        return encodeURIComponent(this.str);␊
      };␊
      ␊
      // to ensure module is wrapped␊
      commonjsGlobal.foo = exports;␊
      });␊
      var encode_1 = encode.encodeURIComponent;␊
      ␊
      /* eslint-disable */␊
      ␊
      const foo = {␊
        str: 'test string',␊
        encodeURIComponent: encode_1␊
      };␊
      ␊
      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;␊
      `,
    }

## index

> Snapshot 1

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

## 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;␊
      `,
    }

## named-exports

> Snapshot 1

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

## ordering

> Snapshot 1

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

## react-apollo

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function unwrapExports (x) {␊
      	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊
      }␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      var commonjsBar = createCommonjsModule(function (module, exports) {␊
      /* eslint-disable no-underscore-dangle */␊
      function Bar() {␊
        this.x = 42;␊
      }␊
      ␊
      exports.__esModule = true;␊
      exports.default = Bar;␊
      });␊
      ␊
      unwrapExports(commonjsBar);␊
      ␊
      var commonjsFoo = createCommonjsModule(function (module, exports) {␊
      /* eslint-disable no-underscore-dangle */␊
      ␊
      ␊
      exports.__esModule = true;␊
      exports.Bar = commonjsBar.default;␊
      });␊
      ␊
      unwrapExports(commonjsFoo);␊
      var commonjsFoo_1 = commonjsFoo.Bar;␊
      ␊
      t.is(new commonjsFoo_1().x, 42);␊
      `,
    }

## reassignment

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      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);␊
      `,
    }

## reexports

> Snapshot 1

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

## resolve-is-cjs-extension

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      const result = 'second';␊
      ␊
      var second = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	result: result␊
      });␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      var require$$0 = getCjsExportFromNamespace(second);␊
      ␊
      t.is(require$$0.result, 'second');␊
      `,
    }

## resolve-is-cjs-filtered

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      const result = 'second';␊
      ␊
      var second = /*#__PURE__*/Object.freeze({␊
      	__proto__: null,␊
      	result: result␊
      });␊
      ␊
      function getCjsExportFromNamespace (n) {␊
      	return n && n['default'] || n;␊
      }␊
      ␊
      var require$$0 = getCjsExportFromNamespace(second);␊
      ␊
      t.is(require$$0.result, 'second');␊
      `,
    }

## 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';␊
      ␊
      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 foo = function augmentThis() {␊
        this.x = 'x';␊
      };␊
      ␊
      commonjsGlobal.y = 'y';␊
      ␊
      const obj = {};␊
      foo.call(obj);␊
      ␊
      t.is(obj.x, 'x');␊
      t.is(commonjsGlobal.y, 'y');␊
      `,
    }

## 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';␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      var foo = createCommonjsModule(function (module) {␊
      module.exports = 'bar';␊
      {␊
        return;␊
      }␊
      });␊
      ␊
      var main = foo;␊
      ␊
      module.exports = main;␊
      `,
    }

## trailing-slash

> Snapshot 1

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

## typeof-require

> Snapshot 1

    {
      'main.js': `'use strict';␊
      ␊
      function createCommonjsModule(fn, module) {␊
      	return module = { exports: {} }, fn(module, module.exports), module.exports;␊
      }␊
      ␊
      function commonjsRequire () {␊
      	throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');␊
      }␊
      ␊
      var foo = createCommonjsModule(function (module) {␊
      if (typeof commonjsRequire === 'function' && commonjsRequire) {␊
        module.exports = 1;␊
      } else {␊
        module.exports = 2;␊
      }␊
      });␊
      ␊
      t.is(foo, 1);␊
      `,
    }
