From 8f029877ef94819e87baf9ba899c261d918b0fd8 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 23 Sep 2024 16:56:42 +0100 Subject: [PATCH] feat(commonjs)!: default strictRequires to true (#1639) * feat(commonjs)!: default strictRequires to true * test: update fixtures * test: update different values * test: update some tests to use auto * test: adapt assertion While the error message has a different variable name, the point of the test is that we get an error. * test: correctly pass options in test Unfortunately, I did not find a way to detect this case from the plugin and show a warning. * fix(commonjs): respect defaultIsModuleExports:false for ES imports from wrapped CommonJS * test: adapt assertions for wrapped CommonJS * docs: improve readme to explain about CommonJS entry points * test: allow tests to specify an entry point for running the code * test: refine late-entry tests * fix(commonjs): treat moduleSideEffects as __PURE__ comments for wrapped modules * fix(commonjs): treat moduleSideEffects as __PURE__ comments for proxied wrapped modules --------- Co-authored-by: Lukas Taegert-Atkinson --- packages/commonjs/README.md | 32 +- packages/commonjs/src/generate-imports.js | 8 +- packages/commonjs/src/helpers.js | 7 + packages/commonjs/src/index.js | 10 +- packages/commonjs/src/proxies.js | 10 +- packages/commonjs/src/resolve-id.js | 6 +- .../commonjs/src/resolve-require-sources.js | 7 +- packages/commonjs/src/utils.js | 4 +- .../fixtures/form/async-function/output.js | 17 +- .../compiled-esm-assign-exports/output.js | 15 +- .../form/compiled-esm-assign-module/output.js | 15 +- .../form/compiled-esm-deconflict/output.js | 15 +- .../output.js | 11 +- .../compiled-esm-define-exports/output.js | 15 +- .../form/compiled-esm-define-module/output.js | 15 +- .../form/compiled-esm-minified/output.js | 13 +- .../form/compiled-esm-only-named/output.js | 15 +- .../compiled-esm-reassign-exports/output.js | 15 +- .../form/constant-template-literal/output.js | 13 +- .../output.js | 15 +- .../output.js | 13 +- .../output.js | 13 +- .../output.js | 13 +- .../output.js | 15 +- .../output.js | 13 +- .../output.js | 11 +- .../output.js | 13 +- .../output.js | 13 +- .../output.js | 15 +- .../output.js | 13 +- .../output.js | 13 +- .../output.js | 13 +- .../form/ignore-ids-function/output.js | 13 +- .../test/fixtures/form/ignore-ids/output.js | 13 +- .../multi-entry-module-exports/output1.js | 17 +- .../multi-entry-module-exports/output2.js | 17 +- .../multiple-var-declarations-b/output.js | 15 +- .../multiple-var-declarations-c/output.js | 17 +- .../form/multiple-var-declarations/output.js | 15 +- .../fixtures/form/no-exports-entry/output.js | 19 +- .../form/no-toplevel-return/output.js | 31 +- .../form/node-require-methods/output.js | 15 +- .../output.js | 15 +- .../output.js | 13 +- .../optimised-default-export-iife/output.js | 17 +- .../form/optimised-default-export/output.js | 13 +- .../output.js | 17 +- .../form/optimised-named-export/output.js | 13 +- .../fixtures/form/require-collision/output.js | 19 +- .../form/typeof-module-exports/output.js | 31 +- .../fixtures/function/dash-name/_config.js | 1 - .../dynamic-require-package-sub/_config.js | 2 +- .../sub/{entry.js => main.js} | 0 .../expose-file-type-detection/_config.js | 10 +- .../module-meta-properties/_config.js | 2 +- .../_config.js | 24 + .../module-side-effects-import-wrapped/bar.js | 1 + .../module-side-effects-import-wrapped/foo.js | 1 + .../main.js | 2 + .../_config.js | 38 + .../foo.js | 2 + .../main.js | 3 + .../module-side-effects-late-entry/_config.js | 16 +- .../_config.js | 24 + .../bar.js | 1 + .../foo.js | 1 + .../main.js | 2 + .../pass-require-to-node-resolve/_config.js | 8 +- packages/commonjs/test/function.js | 7 +- packages/commonjs/test/helpers/util.js | 10 +- .../commonjs/test/snapshots/function.js.md | 5361 ++++++++++++----- .../commonjs/test/snapshots/function.js.snap | Bin 19834 -> 22420 bytes packages/commonjs/test/snapshots/test.js.md | 197 +- packages/commonjs/test/snapshots/test.js.snap | Bin 1584 -> 1708 bytes packages/commonjs/test/test.js | 92 +- 75 files changed, 4787 insertions(+), 1744 deletions(-) rename packages/commonjs/test/fixtures/function/dynamic-require-package-sub/sub/{entry.js => main.js} (100%) create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/_config.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/bar.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/foo.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/main.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/_config.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/foo.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/main.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/_config.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/bar.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/foo.js create mode 100644 packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/main.js diff --git a/packages/commonjs/README.md b/packages/commonjs/README.md index 3024b1e43..be35a5bed 100644 --- a/packages/commonjs/README.md +++ b/packages/commonjs/README.md @@ -49,13 +49,13 @@ When used together with the node-resolve plugin ### `strictRequires` Type: `"auto" | boolean | "debug" | string[]`
-Default: `"auto"` +Default: `true` -By default, this plugin will try to hoist `require` statements as imports to the top of each file. While this works well for many code bases and allows for very efficient ESM output, it does not perfectly capture CommonJS semantics as the initialisation order of required modules will be different. The resultant side effects can include log statements being emitted in a different order, and some code that is dependent on the initialisation order of polyfills in require statements may not work. But it is especially problematic when there are circular `require` calls between CommonJS modules as those often rely on the lazy execution of nested `require` calls. +Historically, this plugin tried to hoist `require` statements as imports to the top of each file. While this works well for many code bases and allows for very efficient ESM output, it does not perfectly capture CommonJS semantics as the initialisation order of required modules will be different. The resultant side effects can include log statements being emitted in a different order, and some code that is dependent on the initialisation order of polyfills in require statements may not work. But it is especially problematic when there are circular `require` calls between CommonJS modules as those often rely on the lazy execution of nested `require` calls. -Setting this option to `true` will wrap all CommonJS files in functions which are executed when they are required for the first time, preserving NodeJS semantics. This is the safest setting and should be used if the generated code does not work correctly with `"auto"`. Note that `strictRequires: true` can have a small impact on the size and performance of generated code, but less so if the code is minified. +The default value of `true` will wrap all CommonJS files in functions which are executed when they are required for the first time, preserving NodeJS semantics. This is the safest setting and should be used if the generated code does not work correctly with `"auto"`. Note that `strictRequires: true` can have a small impact on the size and performance of generated code, but less so if the code is minified. -The default value of `"auto"` will only wrap CommonJS files when they are part of a CommonJS dependency cycle, e.g. an index file that is required by some of its dependencies, or if they are only required in a potentially "conditional" way like from within an if-statement or a function. All other CommonJS files are hoisted. This is the recommended setting for most code bases. Note that the detection of conditional requires can be subject to race conditions if there are both conditional and unconditional requires of the same file, which in edge cases may result in inconsistencies between builds. If you think this is a problem for you, you can avoid this by using any value other than `"auto"` or `"debug"`. +Setting this option to `"auto"` will only wrap CommonJS files when they are part of a CommonJS dependency cycle, e.g. an index file that is required by some of its dependencies, or if they are only required in a potentially "conditional" way like from within an if-statement or a function. All other CommonJS files are hoisted. This is the recommended setting for most code bases. Note that the detection of conditional requires can be subject to race conditions if there are both conditional and unconditional requires of the same file, which in edge cases may result in inconsistencies between builds. If you think this is a problem for you, you can avoid this by using any value other than `"auto"` or `"debug"`. `false` will entirely prevent wrapping and hoist all files. This may still work depending on the nature of cyclic dependencies but will often cause problems. @@ -386,6 +386,30 @@ For these situations, you can change Rollup's behaviour either globally or per m To change this for individual modules, you can supply a function for `requireReturnsDefault` instead. This function will then be called once for each required ES module or external dependency with the corresponding id and allows you to return different values for different modules. +## Using CommonJS files as entry points + +With this plugin, you can also use CommonJS files as entry points. This means, however, that when you are bundling to an ES module, your bundle will only have a default export. If you want named exports instead, you should use an ES module entry point instead that reexports from your CommonJS entry point, e.g. + +```js +// main.cjs, the CommonJS entry +exports.foo = 'foo'; +exports.bar = 'bar'; + +// main.mjs, the ES module entry +export { foo, bar } from './main.cjs'; + +// rollup.config.mjs +export default { + input: 'main.mjs', + output: { + format: 'es', + file: 'bundle.mjs' + } +}; +``` + +When bundling to CommonJS, i.e `output.format === 'cjs'`, make sure that you do not set `output.exports` to `'named'`. The default value of `'auto'` will usually work, but you can also set it explicitly to `'default'`. That makes sure that Rollup assigns the default export that was generated for your CommonJS entry point to `module.exports`, and semantics do not change. + ## Using with @rollup/plugin-node-resolve Since most CommonJS packages you are importing are probably dependencies in `node_modules`, you may need to use [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve): diff --git a/packages/commonjs/src/generate-imports.js b/packages/commonjs/src/generate-imports.js index d91394c15..e2e4a965a 100644 --- a/packages/commonjs/src/generate-imports.js +++ b/packages/commonjs/src/generate-imports.js @@ -165,7 +165,7 @@ function processRequireExpressions( magicString ) { const generateRequireName = getGenerateRequireName(); - for (const { source, id: resolvedId, isCommonJS } of requireTargets) { + for (const { source, id: resolvedId, isCommonJS, wrappedModuleSideEffects } of requireTargets) { const requires = requiresBySource[source]; const name = generateRequireName(requires); let usesRequired = false; @@ -184,7 +184,11 @@ function processRequireExpressions( } else if (canConvertRequire) { needsImport = true; if (isCommonJS === IS_WRAPPED_COMMONJS) { - magicString.overwrite(node.start, node.end, `${name}()`); + magicString.overwrite( + node.start, + node.end, + `${wrappedModuleSideEffects ? '' : '/*@__PURE__*/ '}${name}()` + ); } else if (usesReturnValue) { usesRequired = true; magicString.overwrite(node.start, node.end, name); diff --git a/packages/commonjs/src/helpers.js b/packages/commonjs/src/helpers.js index a795a8aae..aa48bb52a 100644 --- a/packages/commonjs/src/helpers.js +++ b/packages/commonjs/src/helpers.js @@ -2,12 +2,19 @@ export const isWrappedId = (id, suffix) => id.endsWith(suffix); export const wrapId = (id, suffix) => `\0${id}${suffix}`; export const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length); +// A proxy module when a module is required from non-wrapped CommonJS. Is different for ESM and CommonJS requires. export const PROXY_SUFFIX = '?commonjs-proxy'; +// Indicates that a required module is wrapped commonjs and needs special handling. export const WRAPPED_SUFFIX = '?commonjs-wrapped'; +// Indicates that a required module is external export const EXTERNAL_SUFFIX = '?commonjs-external'; +// A helper module that contains the exports object of a module export const EXPORTS_SUFFIX = '?commonjs-exports'; +// A helper module that contains the module object of a module, e.g. when module.exports is reassigned export const MODULE_SUFFIX = '?commonjs-module'; +// A special proxy for CommonJS entry points export const ENTRY_SUFFIX = '?commonjs-entry'; +// A proxy when wrapped ESM is required from CommonJS export const ES_IMPORT_SUFFIX = '?commonjs-es-import'; export const DYNAMIC_MODULES_ID = '\0commonjs-dynamic-modules'; diff --git a/packages/commonjs/src/index.js b/packages/commonjs/src/index.js index a7fb65938..ed321dc1b 100644 --- a/packages/commonjs/src/index.js +++ b/packages/commonjs/src/index.js @@ -1,4 +1,4 @@ -import { extname, relative, resolve, dirname } from 'path'; +import { dirname, extname, relative, resolve } from 'path'; import { createFilter } from '@rollup/pluginutils'; @@ -239,7 +239,7 @@ export default function commonjs(options = {}) { } }, - load(id) { + async load(id) { if (id === HELPERS_ID) { return getHelpersModule(); } @@ -285,7 +285,11 @@ export default function commonjs(options = {}) { if (isWrappedId(id, ES_IMPORT_SUFFIX)) { const actualId = unwrapId(id, ES_IMPORT_SUFFIX); - return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId)); + return getEsImportProxy( + actualId, + getDefaultIsModuleExports(actualId), + (await this.load({ id: actualId })).moduleSideEffects + ); } if (id === DYNAMIC_MODULES_ID) { diff --git a/packages/commonjs/src/proxies.js b/packages/commonjs/src/proxies.js index 57b71b867..2e8d9f270 100644 --- a/packages/commonjs/src/proxies.js +++ b/packages/commonjs/src/proxies.js @@ -57,26 +57,28 @@ export function getEntryProxy(id, defaultIsModuleExports, getModuleInfo, shebang } return shebang + code; } - const result = getEsImportProxy(id, defaultIsModuleExports); + const result = getEsImportProxy(id, defaultIsModuleExports, true); return { ...result, code: shebang + result.code }; } -export function getEsImportProxy(id, defaultIsModuleExports) { +export function getEsImportProxy(id, defaultIsModuleExports, moduleSideEffects) { const name = getName(id); const exportsName = `${name}Exports`; const requireModule = `require${capitalize(name)}`; let code = `import { getDefaultExportFromCjs } from "${HELPERS_ID}";\n` + `import { __require as ${requireModule} } from ${JSON.stringify(id)};\n` + - `var ${exportsName} = ${requireModule}();\n` + + `var ${exportsName} = ${moduleSideEffects ? '' : '/*@__PURE__*/ '}${requireModule}();\n` + `export { ${exportsName} as __moduleExports };`; if (defaultIsModuleExports === true) { code += `\nexport { ${exportsName} as default };`; + } else if (defaultIsModuleExports === false) { + code += `\nexport default ${exportsName}.default;`; } else { - code += `export default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`; + code += `\nexport default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`; } return { code, diff --git a/packages/commonjs/src/resolve-id.js b/packages/commonjs/src/resolve-id.js index 80be69079..a2597d857 100644 --- a/packages/commonjs/src/resolve-id.js +++ b/packages/commonjs/src/resolve-id.js @@ -63,11 +63,7 @@ export default function getResolveId(extensions, isPossibleCjsId) { // All logic below is specific to ES imports. // Also, if we do not skip this logic for requires that are resolved while // transforming a commonjs file, it can easily lead to deadlocks. - if ( - customOptions && - customOptions['node-resolve'] && - customOptions['node-resolve'].isRequire - ) { + if (customOptions?.['node-resolve']?.isRequire) { return null; } const currentlyResolvingForParent = currentlyResolving.get(importer); diff --git a/packages/commonjs/src/resolve-require-sources.js b/packages/commonjs/src/resolve-require-sources.js index 22d9e3f65..be662ee0f 100644 --- a/packages/commonjs/src/resolve-require-sources.js +++ b/packages/commonjs/src/resolve-require-sources.js @@ -192,13 +192,14 @@ export function getRequireResolver(extensions, detectCyclesAndConditional, curre // eslint-disable-next-line no-multi-assign const isCommonJS = (parentMeta.isRequiredCommonJS[dependencyId] = getTypeForFullyAnalyzedModule(dependencyId)); + const isWrappedCommonJS = isCommonJS === IS_WRAPPED_COMMONJS; fullyAnalyzedModules[dependencyId] = true; return { + wrappedModuleSideEffects: + isWrappedCommonJS && rollupContext.getModuleInfo(dependencyId).moduleSideEffects, source: sources[index].source, id: allowProxy - ? isCommonJS === IS_WRAPPED_COMMONJS - ? wrapId(dependencyId, WRAPPED_SUFFIX) - : wrapId(dependencyId, PROXY_SUFFIX) + ? wrapId(dependencyId, isWrappedCommonJS ? WRAPPED_SUFFIX : PROXY_SUFFIX) : dependencyId, isCommonJS }; diff --git a/packages/commonjs/src/utils.js b/packages/commonjs/src/utils.js index 92866c706..993141793 100644 --- a/packages/commonjs/src/utils.js +++ b/packages/commonjs/src/utils.js @@ -43,10 +43,10 @@ export function capitalize(name) { export function getStrictRequiresFilter({ strictRequires }) { switch (strictRequires) { - case true: - return { strictRequiresFilter: () => true, detectCyclesAndConditional: false }; // eslint-disable-next-line no-undefined case undefined: + case true: + return { strictRequiresFilter: () => true, detectCyclesAndConditional: false }; case 'auto': case 'debug': case null: diff --git a/packages/commonjs/test/fixtures/form/async-function/output.js b/packages/commonjs/test/fixtures/form/async-function/output.js index 6397b529a..1783fa95c 100644 --- a/packages/commonjs/test/fixtures/form/async-function/output.js +++ b/packages/commonjs/test/fixtures/form/async-function/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = async function () { - // TODO -}; +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = async function () { + // TODO + }; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-assign-exports/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-assign-exports/output.js index 702322e8f..53d8749c4 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-assign-exports/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-assign-exports/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-assign-exports/input.js?commonjs-exports"; -input.__esModule = true; -var _default = input.default = 'x'; -var foo = input.foo = 'foo'; +var hasRequiredInput; -export { input as __moduleExports, foo, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.__esModule = true; + input.default = 'x'; + input.foo = 'foo'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-assign-module/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-assign-module/output.js index ca4bf64fd..c1396bec7 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-assign-module/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-assign-module/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-assign-module/input.js?commonjs-exports"; -input.__esModule = true; -var _default = input.default = 'x'; -var foo = input.foo = 'foo'; +var hasRequiredInput; -export { input as __moduleExports, foo, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.__esModule = true; + input.default = 'x'; + input.foo = 'foo'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-deconflict/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-deconflict/output.js index 181ee6c56..162ff2c0d 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-deconflict/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-deconflict/output.js @@ -1,9 +1,16 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-deconflict/input.js?commonjs-exports"; -Object.defineProperty(input, '__esModule', { value: true }); -var foo_1 = input.foo = 'bar'; +var hasRequiredInput; -const foo = 'also bar'; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + Object.defineProperty(input, '__esModule', { value: true }); + input.foo = 'bar'; -export { input as __moduleExports, foo_1 as foo, input as default }; + const foo = 'also bar'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-define-exports-empty/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-define-exports-empty/output.js index 7e4625de4..378aed12a 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-define-exports-empty/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-define-exports-empty/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-define-exports-empty/input.js?commonjs-exports"; -Object.defineProperty(input, "__esModule", { value: true }); +var hasRequiredInput; -export { input as __moduleExports, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + Object.defineProperty(input, "__esModule", { value: true }); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-define-exports/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-define-exports/output.js index 935ba0182..644d26375 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-define-exports/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-define-exports/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-define-exports/input.js?commonjs-exports"; -Object.defineProperty(input, '__esModule', { value: true }); -var _default = input.default = 'x'; -var foo = input.foo = 'foo'; +var hasRequiredInput; -export { input as __moduleExports, foo, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + Object.defineProperty(input, '__esModule', { value: true }); + input.default = 'x'; + input.foo = 'foo'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-define-module/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-define-module/output.js index 3ab014522..d8a8cf6b1 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-define-module/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-define-module/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-define-module/input.js?commonjs-exports"; -Object.defineProperty(input, '__esModule', { value: true }); -var _default = input.default = 'x'; -var foo = input.foo = 'foo'; +var hasRequiredInput; -export { input as __moduleExports, foo, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + Object.defineProperty(input, '__esModule', { value: true }); + input.default = 'x'; + input.foo = 'foo'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-minified/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-minified/output.js index 0e285da36..037a97a7c 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-minified/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-minified/output.js @@ -1,7 +1,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-minified/input.js?commonjs-exports"; -Object.defineProperty(input, '__esModule', { value: !0 }); -var foo = input.foo = 'foo'; +var hasRequiredInput; -export { input as __moduleExports, foo, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + Object.defineProperty(input, '__esModule', { value: !0 }); + input.foo = 'foo'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-only-named/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-only-named/output.js index 77af113cb..e9d6de726 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-only-named/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-only-named/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/compiled-esm-only-named/input.js?commonjs-exports"; -Object.defineProperty(input, '__esModule', { value: true }); -var foo = input.foo = 'bar'; -var bar = input.bar = 'foo'; +var hasRequiredInput; -export { input as __moduleExports, foo, bar, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + Object.defineProperty(input, '__esModule', { value: true }); + input.foo = 'bar'; + input.bar = 'foo'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/compiled-esm-reassign-exports/output.js b/packages/commonjs/test/fixtures/form/compiled-esm-reassign-exports/output.js index 451c438d5..41ec21660 100644 --- a/packages/commonjs/test/fixtures/form/compiled-esm-reassign-exports/output.js +++ b/packages/commonjs/test/fixtures/form/compiled-esm-reassign-exports/output.js @@ -2,9 +2,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __module as inputModule } from "\u0000fixtures/form/compiled-esm-reassign-exports/input.js?commonjs-module"; var input = inputModule.exports; -Object.defineProperty(input, '__esModule', { value: true }); -inputModule.exports = { foo: 'bar' }; +var hasRequiredInput; -var inputExports = inputModule.exports; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(inputExports); -export { inputExports as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return inputModule.exports; + hasRequiredInput = 1; + Object.defineProperty(input, '__esModule', { value: true }); + inputModule.exports = { foo: 'bar' }; + return inputModule.exports; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/constant-template-literal/output.js b/packages/commonjs/test/fixtures/form/constant-template-literal/output.js index 025ab006a..06cb1c24f 100644 --- a/packages/commonjs/test/fixtures/form/constant-template-literal/output.js +++ b/packages/commonjs/test/fixtures/form/constant-template-literal/output.js @@ -2,7 +2,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/constant-template-literal/input.js?commonjs-exports"; import require$$0 from "\u0000CWD/fixtures/form/constant-template-literal/tape.js?commonjs-proxy"; -var foo = require$$0; -console.log(foo); +var hasRequiredInput; -export { input as __moduleExports, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var foo = require$$0; + console.log(foo); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/output.js index 3a3ce2c18..831bb1fa3 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-__esModule/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-auto-__esModule/input.js?commonjs-exports"; -input.__esModule = true; -var _default = input.default = 2; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.__esModule = true; + input.default = 2; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/output.js index 1d4926528..b9e8423af 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-no-__esModule/output.js @@ -1,7 +1,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-auto-no-__esModule/input.js?commonjs-exports"; -var _default = input.default = 2; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.default = 2; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-__esModule/output.js index 40fb3ba6f..f5f6303f8 100644 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-__esModule/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = { __esModule: true, default: { foo: 'bar' }} +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = { __esModule: true, default: { foo: 'bar' }} + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-no-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-no-__esModule/output.js index 4efd57b3c..50bf81c14 100644 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-no-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-auto-reassign-exports-no-__esModule/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = { default: { foo: 'bar' }} +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = { default: { foo: 'bar' }} + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/output.js index d1d5aa31f..b3602ddbf 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-__esModule/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-false-__esModule/input.js?commonjs-exports"; -input.__esModule = true; -var _default = input.default = 2; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.__esModule = true; + input.default = 2; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/output.js index 45447dcfa..b47675abc 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-__esModule/output.js @@ -1,7 +1,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-false-no-__esModule/input.js?commonjs-exports"; -var _default = input.default = 2; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, _default as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.default = 2; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/output.js index d7fc090e4..2d0864603 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-no-default/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-false-no-default/input.js?commonjs-exports"; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-__esModule/output.js index 438f5201c..b1afbb32e 100644 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-__esModule/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = { __esModule: true, default: { foo: 'bar' }}; +var input; +var hasRequiredInput; -export default input.default; -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = { __esModule: true, default: { foo: 'bar' }}; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-no-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-no-__esModule/output.js index 0b1ca5133..f9f9877a7 100644 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-no-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-false-reassign-exports-no-__esModule/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = { default: { foo: 'bar' }}; +var input; +var hasRequiredInput; -export default input.default; -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = { default: { foo: 'bar' }}; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/output.js index b6e082a77..8c401a270 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-__esModule/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-true-__esModule/input.js?commonjs-exports"; -input.__esModule = true; -var _default = input.default = 2; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.__esModule = true; + input.default = 2; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/output.js index 2e91cdb4c..e0a47bc60 100755 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-no-__esModule/output.js @@ -1,7 +1,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/defaultIsModuleExports-true-no-__esModule/input.js?commonjs-exports"; -var _default = input.default = 2; -var named = input.named = 3; +var hasRequiredInput; -export { input as __moduleExports, named, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.default = 2; + input.named = 3; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-__esModule/output.js index 31c37d0a3..b1afbb32e 100644 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-__esModule/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = { __esModule: true, default: { foo: 'bar' }}; +var input; +var hasRequiredInput; -export default input; -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = { __esModule: true, default: { foo: 'bar' }}; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-no-__esModule/output.js b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-no-__esModule/output.js index d1ad5b5ac..f9f9877a7 100644 --- a/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-no-__esModule/output.js +++ b/packages/commonjs/test/fixtures/form/defaultIsModuleExports-true-reassign-exports-no-__esModule/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = { default: { foo: 'bar' }}; +var input; +var hasRequiredInput; -export default input; -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = { default: { foo: 'bar' }}; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/ignore-ids-function/output.js b/packages/commonjs/test/fixtures/form/ignore-ids-function/output.js index eae922656..f94836607 100644 --- a/packages/commonjs/test/fixtures/form/ignore-ids-function/output.js +++ b/packages/commonjs/test/fixtures/form/ignore-ids-function/output.js @@ -2,7 +2,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/ignore-ids-function/input.js?commonjs-exports"; import require$$0 from "\u0000CWD/fixtures/form/ignore-ids-function/bar.js?commonjs-proxy"; -var foo = require( 'foo' ); -var bar = require$$0; +var hasRequiredInput; -export { input as __moduleExports, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var foo = require( 'foo' ); + var bar = require$$0; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/ignore-ids/output.js b/packages/commonjs/test/fixtures/form/ignore-ids/output.js index fb26608f5..9397355e5 100644 --- a/packages/commonjs/test/fixtures/form/ignore-ids/output.js +++ b/packages/commonjs/test/fixtures/form/ignore-ids/output.js @@ -2,7 +2,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/ignore-ids/input.js?commonjs-exports"; import require$$0 from "\u0000CWD/fixtures/form/ignore-ids/bar.js?commonjs-proxy"; -var foo = require( 'foo' ); -var bar = require$$0; +var hasRequiredInput; -export { input as __moduleExports, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var foo = require( 'foo' ); + var bar = require$$0; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output1.js b/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output1.js index db808610c..72c4422cb 100644 --- a/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output1.js +++ b/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output1.js @@ -1,10 +1,17 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import require$$0 from "\u0000CWD/fixtures/form/multi-entry-module-exports/input2.js?commonjs-proxy"; -const t2 = require$$0; +var input1; +var hasRequiredInput1; -console.log(t2); -var input1 = 1; +function requireInput1 () { + if (hasRequiredInput1) return input1; + hasRequiredInput1 = 1; + const t2 = require$$0; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input1); -export { input1 as __moduleExports }; + console.log(t2); + input1 = 1; + return input1; +} + +export { requireInput1 as __require }; diff --git a/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output2.js b/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output2.js index 3ddeba2ba..3fc1db442 100644 --- a/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output2.js +++ b/packages/commonjs/test/fixtures/form/multi-entry-module-exports/output2.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input2 = { - a: 2 -}; +var input2; +var hasRequiredInput2; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input2); -export { input2 as __moduleExports }; +function requireInput2 () { + if (hasRequiredInput2) return input2; + hasRequiredInput2 = 1; + input2 = { + a: 2 + }; + return input2; +} + +export { requireInput2 as __require }; diff --git a/packages/commonjs/test/fixtures/form/multiple-var-declarations-b/output.js b/packages/commonjs/test/fixtures/form/multiple-var-declarations-b/output.js index 506d1bed7..383c90b5c 100644 --- a/packages/commonjs/test/fixtures/form/multiple-var-declarations-b/output.js +++ b/packages/commonjs/test/fixtures/form/multiple-var-declarations-b/output.js @@ -2,9 +2,16 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/multiple-var-declarations-b/input.js?commonjs-exports"; import require$$0 from "\u0000CWD/fixtures/form/multiple-var-declarations-b/a.js?commonjs-proxy"; -var a = require$$0 - , b = 42; +var hasRequiredInput; -console.log( a, b ); +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var a = require$$0 + , b = 42; -export { input as __moduleExports, input as default }; + console.log( a, b ); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/multiple-var-declarations-c/output.js b/packages/commonjs/test/fixtures/form/multiple-var-declarations-c/output.js index cc146904a..bfab8acdd 100644 --- a/packages/commonjs/test/fixtures/form/multiple-var-declarations-c/output.js +++ b/packages/commonjs/test/fixtures/form/multiple-var-declarations-c/output.js @@ -2,10 +2,17 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/multiple-var-declarations-c/input.js?commonjs-exports"; import require$$0 from "\u0000CWD/fixtures/form/multiple-var-declarations-c/b.js?commonjs-proxy"; -var a = 'a' - , b = require$$0 - , c = 'c'; +var hasRequiredInput; -console.log( a, b, c ); +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var a = 'a' + , b = require$$0 + , c = 'c'; -export { input as __moduleExports, input as default }; + console.log( a, b, c ); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/multiple-var-declarations/output.js b/packages/commonjs/test/fixtures/form/multiple-var-declarations/output.js index 2386ce161..2677f9287 100644 --- a/packages/commonjs/test/fixtures/form/multiple-var-declarations/output.js +++ b/packages/commonjs/test/fixtures/form/multiple-var-declarations/output.js @@ -3,9 +3,16 @@ import { __exports as input } from "\u0000fixtures/form/multiple-var-declaration import require$$0 from "\u0000CWD/fixtures/form/multiple-var-declarations/a.js?commonjs-proxy"; import require$$1 from "\u0000CWD/fixtures/form/multiple-var-declarations/b.js?commonjs-proxy"; -var a = require$$0() - , b = require$$1; +var hasRequiredInput; -console.log( a, b ); +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var a = require$$0() + , b = require$$1; -export { input as __moduleExports, input as default }; + console.log( a, b ); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/no-exports-entry/output.js b/packages/commonjs/test/fixtures/form/no-exports-entry/output.js index d223e0b61..7be92805e 100644 --- a/packages/commonjs/test/fixtures/form/no-exports-entry/output.js +++ b/packages/commonjs/test/fixtures/form/no-exports-entry/output.js @@ -2,12 +2,19 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input_1 } from "\u0000fixtures/form/no-exports-entry/input.js?commonjs-exports"; import require$$0 from "\u0000CWD/fixtures/form/no-exports-entry/dummy.js?commonjs-proxy"; -var dummy = require$$0; +var hasRequiredInput; -var foo = function () { - return; -}; +function requireInput () { + if (hasRequiredInput) return input_1; + hasRequiredInput = 1; + var dummy = require$$0; -var input = 42; + var foo = function () { + return; + }; -export { input_1 as __moduleExports, input_1 as default }; + var input = 42; + return input_1; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/no-toplevel-return/output.js b/packages/commonjs/test/fixtures/form/no-toplevel-return/output.js index 5a4eb12db..4753e1899 100644 --- a/packages/commonjs/test/fixtures/form/no-toplevel-return/output.js +++ b/packages/commonjs/test/fixtures/form/no-toplevel-return/output.js @@ -1,18 +1,25 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var foo = function () { - return; -}; +var input; +var hasRequiredInput; -var bar = () => { - return; -}; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var foo = function () { + return; + }; -function baz () { - return; -} + var bar = () => { + return; + }; + + function baz () { + return; + } -var input = 42; + input = 42; + return input; +} -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/node-require-methods/output.js b/packages/commonjs/test/fixtures/form/node-require-methods/output.js index 6a1ec9188..b54628011 100644 --- a/packages/commonjs/test/fixtures/form/node-require-methods/output.js +++ b/packages/commonjs/test/fixtures/form/node-require-methods/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/node-require-methods/input.js?commonjs-exports"; -var getFilePath = input.getFilePath = function getFilePath(someFile) { - return require.resolve(someFile); -}; +var hasRequiredInput; -export { input as __moduleExports, getFilePath, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.getFilePath = function getFilePath(someFile) { + return require.resolve(someFile); + }; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/optimised-default-export-function-double-assign/output.js b/packages/commonjs/test/fixtures/form/optimised-default-export-function-double-assign/output.js index d6d7bba6e..bde947186 100644 --- a/packages/commonjs/test/fixtures/form/optimised-default-export-function-double-assign/output.js +++ b/packages/commonjs/test/fixtures/form/optimised-default-export-function-double-assign/output.js @@ -1,7 +1,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var bar; -var input = bar = function foo () {}; +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var bar; + input = bar = function foo () {}; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/optimised-default-export-function/output.js b/packages/commonjs/test/fixtures/form/optimised-default-export-function/output.js index b84d3b56b..227278be2 100644 --- a/packages/commonjs/test/fixtures/form/optimised-default-export-function/output.js +++ b/packages/commonjs/test/fixtures/form/optimised-default-export-function/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = function foo () {}; +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = function foo () {}; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/optimised-default-export-iife/output.js b/packages/commonjs/test/fixtures/form/optimised-default-export-iife/output.js index 3a73fd6c5..024f75ea3 100644 --- a/packages/commonjs/test/fixtures/form/optimised-default-export-iife/output.js +++ b/packages/commonjs/test/fixtures/form/optimised-default-export-iife/output.js @@ -1,8 +1,15 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = (function foo () { - return function fooChild() {}; -}()); +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = (function foo () { + return function fooChild() {}; + }()); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/optimised-default-export/output.js b/packages/commonjs/test/fixtures/form/optimised-default-export/output.js index 3a01fdab9..ec717ec7b 100644 --- a/packages/commonjs/test/fixtures/form/optimised-default-export/output.js +++ b/packages/commonjs/test/fixtures/form/optimised-default-export/output.js @@ -1,6 +1,13 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; -var input = 42; +var input; +var hasRequiredInput; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(input); -export { input as __moduleExports }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input = 42; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/optimised-named-export-conflicts/output.js b/packages/commonjs/test/fixtures/form/optimised-named-export-conflicts/output.js index c79973ef3..c1d026f8a 100644 --- a/packages/commonjs/test/fixtures/form/optimised-named-export-conflicts/output.js +++ b/packages/commonjs/test/fixtures/form/optimised-named-export-conflicts/output.js @@ -1,10 +1,17 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/optimised-named-export-conflicts/input.js?commonjs-exports"; -var foo = 1; -var bar = 2; +var hasRequiredInput; -var foo_1 = input.foo = 'a'; -var bar_1 = input.bar = 'b'; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + var foo = 1; + var bar = 2; -export { input as __moduleExports, foo_1 as foo, bar_1 as bar, input as default }; + input.foo = 'a'; + input.bar = 'b'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/optimised-named-export/output.js b/packages/commonjs/test/fixtures/form/optimised-named-export/output.js index 97a1bdaf1..ec1ee7631 100644 --- a/packages/commonjs/test/fixtures/form/optimised-named-export/output.js +++ b/packages/commonjs/test/fixtures/form/optimised-named-export/output.js @@ -1,7 +1,14 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/optimised-named-export/input.js?commonjs-exports"; -var foo = input.foo = 'a'; -var bar = input.bar = 'b'; +var hasRequiredInput; -export { input as __moduleExports, foo, bar, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + input.foo = 'a'; + input.bar = 'b'; + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/require-collision/output.js b/packages/commonjs/test/fixtures/form/require-collision/output.js index 89bc357b5..ecfd721cc 100644 --- a/packages/commonjs/test/fixtures/form/require-collision/output.js +++ b/packages/commonjs/test/fixtures/form/require-collision/output.js @@ -2,10 +2,17 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __exports as input } from "\u0000fixtures/form/require-collision/input.js?commonjs-exports"; import require$$1 from "\u0000CWD/fixtures/form/require-collision/foo.js?commonjs-proxy"; -(function() { - var foo = require$$1; - var require$$0 = "FAIL"; - console.log(foo); -})(); +var hasRequiredInput; -export { input as __moduleExports, input as default }; +function requireInput () { + if (hasRequiredInput) return input; + hasRequiredInput = 1; + (function() { + var foo = require$$1; + var require$$0 = "FAIL"; + console.log(foo); + })(); + return input; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/form/typeof-module-exports/output.js b/packages/commonjs/test/fixtures/form/typeof-module-exports/output.js index b55ee3401..2d1dda7ea 100644 --- a/packages/commonjs/test/fixtures/form/typeof-module-exports/output.js +++ b/packages/commonjs/test/fixtures/form/typeof-module-exports/output.js @@ -2,18 +2,23 @@ import * as commonjsHelpers from "_commonjsHelpers.js"; import { __module as inputModule } from "\u0000fixtures/form/typeof-module-exports/input.js?commonjs-module"; var input = inputModule.exports; -(function (module, exports) { - var foo = 42; +var hasRequiredInput; - if ( 'object' === 'object' && 'object' === 'object' ) { - module.exports = foo; - } else if ( typeof undefined === 'function' && undefined.amd ) { - undefined([], function () { return foo; }); - } else { - window.foo = foo; - } -} (inputModule, inputModule.exports)); +function requireInput () { + if (hasRequiredInput) return inputModule.exports; + hasRequiredInput = 1; + (function (module, exports) { + var foo = 42; -var inputExports = inputModule.exports; -export default /*@__PURE__*/commonjsHelpers.getDefaultExportFromCjs(inputExports); -export { inputExports as __moduleExports }; + if ( 'object' === 'object' && 'object' === 'object' ) { + module.exports = foo; + } else if ( typeof undefined === 'function' && undefined.amd ) { + undefined([], function () { return foo; }); + } else { + window.foo = foo; + } + } (inputModule, inputModule.exports)); + return inputModule.exports; +} + +export { requireInput as __require }; diff --git a/packages/commonjs/test/fixtures/function/dash-name/_config.js b/packages/commonjs/test/fixtures/function/dash-name/_config.js index 4fd62f385..8a3c53e15 100644 --- a/packages/commonjs/test/fixtures/function/dash-name/_config.js +++ b/packages/commonjs/test/fixtures/function/dash-name/_config.js @@ -1,7 +1,6 @@ module.exports = { options: { output: { - file: 'output/bundle.js', format: 'cjs' } } diff --git a/packages/commonjs/test/fixtures/function/dynamic-require-package-sub/_config.js b/packages/commonjs/test/fixtures/function/dynamic-require-package-sub/_config.js index 486c9e07b..498afbe1b 100755 --- a/packages/commonjs/test/fixtures/function/dynamic-require-package-sub/_config.js +++ b/packages/commonjs/test/fixtures/function/dynamic-require-package-sub/_config.js @@ -6,7 +6,7 @@ const { nodeResolve } = require('@rollup/plugin-node-resolve'); module.exports = { description: 'resolves imports of node_modules from subdirectories', options: { - input: path.join(__dirname, 'sub/entry.js'), + input: path.join(__dirname, 'sub/main.js'), plugins: [nodeResolve(), json()] }, pluginOptions: { diff --git a/packages/commonjs/test/fixtures/function/dynamic-require-package-sub/sub/entry.js b/packages/commonjs/test/fixtures/function/dynamic-require-package-sub/sub/main.js similarity index 100% rename from packages/commonjs/test/fixtures/function/dynamic-require-package-sub/sub/entry.js rename to packages/commonjs/test/fixtures/function/dynamic-require-package-sub/sub/main.js diff --git a/packages/commonjs/test/fixtures/function/expose-file-type-detection/_config.js b/packages/commonjs/test/fixtures/function/expose-file-type-detection/_config.js index 1a9415bd0..c14ca7b9e 100644 --- a/packages/commonjs/test/fixtures/function/expose-file-type-detection/_config.js +++ b/packages/commonjs/test/fixtures/function/expose-file-type-detection/_config.js @@ -11,16 +11,18 @@ module.exports = { { moduleParsed({ id, meta: { commonjs } }) { if (id === ID_OTHER) { - if (commonjs.isCommonJS !== true) { + if (commonjs.isCommonJS !== 'withRequireFunction') { throw new Error( `File "${id}" wrongly detected: isCommonJS === ${JSON.stringify( commonjs.isCommonJS - )}` + )} instead of "withRequireFunction"` ); } - } else if (commonjs && commonjs.isCommonJS !== false) { + } else if (commonjs && !!commonjs.isCommonJS) { throw new Error( - `File "${id}" wrongly detected: isCommonJS === ${JSON.stringify(commonjs.isCommonJS)}` + `File "${id}" wrongly detected: isCommonJS === ${JSON.stringify( + commonjs.isCommonJS + )} instead of false` ); } } diff --git a/packages/commonjs/test/fixtures/function/module-meta-properties/_config.js b/packages/commonjs/test/fixtures/function/module-meta-properties/_config.js index 63b09ffad..1e924b4bf 100644 --- a/packages/commonjs/test/fixtures/function/module-meta-properties/_config.js +++ b/packages/commonjs/test/fixtures/function/module-meta-properties/_config.js @@ -6,7 +6,7 @@ module.exports = { async resolveId(source, importer, options) { if (source.endsWith('dep.js')) { return { - ...(await this.resolve(source, importer, { skipSelf: true, ...options })), + ...(await this.resolve(source, importer, options)), meta: { test: 'provided' } }; } diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/_config.js b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/_config.js new file mode 100644 index 000000000..dbd6590af --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/_config.js @@ -0,0 +1,24 @@ +module.exports = { + description: 'respects module-side-effects when importing wrapped dependencies', + options: { + plugins: [ + { + name: 'test', + async resolveId(source, importer, options) { + if (source.endsWith('./foo.js')) { + const resolved = await this.resolve(source, importer, options); + return { ...resolved, moduleSideEffects: false }; + } + return null; + } + } + ] + }, + pluginOptions: { + strictRequires: true + }, + global: (global, t) => { + t.is(global.foo, undefined); + t.is(global.bar, 'bar'); + } +}; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/bar.js b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/bar.js new file mode 100644 index 000000000..7abd01cbe --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/bar.js @@ -0,0 +1 @@ +global.bar = 'bar'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/foo.js b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/foo.js new file mode 100644 index 000000000..3eb324194 --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/foo.js @@ -0,0 +1 @@ +global.foo = 'foo'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/main.js b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/main.js new file mode 100644 index 000000000..7eee06cba --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-import-wrapped/main.js @@ -0,0 +1,2 @@ +import { foo } from './foo.js'; +import { bar } from './bar.js'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/_config.js b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/_config.js new file mode 100644 index 000000000..e98adb7bf --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/_config.js @@ -0,0 +1,38 @@ +const path = require('path'); +const assert = require('assert'); + +let referenceId; +const testEntry = 'generated-foo.js'; + +module.exports = { + description: + 'use correct side-effects flags for files that become entry points after they are loaded (strictRequires: true)', + testEntry, + options: { + treeshake: { moduleSideEffects: false }, + plugins: [ + { + name: 'test', + load(id) { + if (id.endsWith('foo.js')) { + referenceId = this.emitFile({ type: 'chunk', id: path.join(__dirname, 'foo.js') }); + } + }, + generateBundle() { + assert.strictEqual(this.getFileName(referenceId), testEntry); + }, + moduleParsed({ id, code }) { + console.log('\n===', id); + console.log(code); + } + } + ], + output: { chunkFileNames: 'generated-[name].js' } + }, + pluginOptions: { + strictRequires: true + }, + global: (global, t) => { + t.is(global.foo, 'foo'); + } +}; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/foo.js b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/foo.js new file mode 100644 index 000000000..53d1fab39 --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/foo.js @@ -0,0 +1,2 @@ +// This side-effect will only be respected if this is an entry point +global.foo = 'foo'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/main.js b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/main.js new file mode 100644 index 000000000..60af16024 --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry-strict/main.js @@ -0,0 +1,3 @@ +import './foo.js'; + +export default 'main'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-late-entry/_config.js b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry/_config.js index 8c1d053bd..09d728ee6 100644 --- a/packages/commonjs/test/fixtures/function/module-side-effects-late-entry/_config.js +++ b/packages/commonjs/test/fixtures/function/module-side-effects-late-entry/_config.js @@ -1,21 +1,33 @@ const path = require('path'); +const assert = require('assert'); + +let referenceId; +const testEntry = 'generated-foo2.js'; module.exports = { description: - 'use correct side-effects flags for files that become entry points after they are loaded', + 'use correct side-effects flags for files that become entry points after they are loaded (strictRequires: false)', + testEntry, options: { treeshake: { moduleSideEffects: false }, plugins: [ { + name: 'test', load(id) { if (id.endsWith('foo.js')) { - this.emitFile({ type: 'chunk', id: path.join(__dirname, 'foo.js') }); + referenceId = this.emitFile({ type: 'chunk', id: path.join(__dirname, 'foo.js') }); } + }, + generateBundle() { + assert.strictEqual(this.getFileName(referenceId), testEntry); } } ], output: { chunkFileNames: 'generated-[name].js' } }, + pluginOptions: { + strictRequires: false + }, global: (global, t) => { t.is(global.foo, 'foo'); } diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/_config.js b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/_config.js new file mode 100644 index 000000000..f4526f347 --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/_config.js @@ -0,0 +1,24 @@ +module.exports = { + description: 'respects module-side-effects when requiring wrapped dependencies', + options: { + plugins: [ + { + name: 'test', + async resolveId(source, importer, options) { + if (source.endsWith('./foo.js')) { + const resolved = await this.resolve(source, importer, options); + return { ...resolved, moduleSideEffects: false }; + } + return null; + } + } + ] + }, + pluginOptions: { + strictRequires: true + }, + global: (global, t) => { + t.is(global.foo, undefined); + t.is(global.bar, 'bar'); + } +}; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/bar.js b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/bar.js new file mode 100644 index 000000000..7abd01cbe --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/bar.js @@ -0,0 +1 @@ +global.bar = 'bar'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/foo.js b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/foo.js new file mode 100644 index 000000000..3eb324194 --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/foo.js @@ -0,0 +1 @@ +global.foo = 'foo'; diff --git a/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/main.js b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/main.js new file mode 100644 index 000000000..7d0388ee2 --- /dev/null +++ b/packages/commonjs/test/fixtures/function/module-side-effects-require-wrapped/main.js @@ -0,0 +1,2 @@ +const unusedFoo = require('./foo.js'); +const unusedBar = require('./bar.js'); diff --git a/packages/commonjs/test/fixtures/function/pass-require-to-node-resolve/_config.js b/packages/commonjs/test/fixtures/function/pass-require-to-node-resolve/_config.js index 3e1ac41b8..9deb774a8 100644 --- a/packages/commonjs/test/fixtures/function/pass-require-to-node-resolve/_config.js +++ b/packages/commonjs/test/fixtures/function/pass-require-to-node-resolve/_config.js @@ -6,13 +6,13 @@ module.exports = { plugins: [ { name: 'node-resolve-mock', - resolveId(source, importer, { custom }) { - const { isRequire } = (custom && custom['node-resolve']) || {}; + resolveId(source, importer, options) { + const { isRequire } = options.custom?.['node-resolve'] || {}; if (source === './foo') { - return this.resolve(isRequire ? './foo-required' : './foo-imported', importer); + return this.resolve(isRequire ? './foo-required' : './foo-imported', importer, options); } if (source === './bar') { - return this.resolve(isRequire ? './bar-required' : './bar-imported', importer); + return this.resolve(isRequire ? './bar-required' : './bar-imported', importer, options); } return null; } diff --git a/packages/commonjs/test/function.js b/packages/commonjs/test/function.js index e3af774a4..b8701ef74 100644 --- a/packages/commonjs/test/function.js +++ b/packages/commonjs/test/function.js @@ -48,7 +48,12 @@ readdirSync('./fixtures/function').forEach((dir) => { console.groupEnd(); } } - const { exports, global, error } = runCodeSplitTest(codeMap, t, config.context); + const { exports, global, error } = runCodeSplitTest( + codeMap, + t, + config.testEntry || 'main.js', + config.context + ); if (config.exports) config.exports(exports, t); if (config.global) config.global(global, t); diff --git a/packages/commonjs/test/helpers/util.js b/packages/commonjs/test/helpers/util.js index 7ab558988..4d8bb2fda 100644 --- a/packages/commonjs/test/helpers/util.js +++ b/packages/commonjs/test/helpers/util.js @@ -27,7 +27,7 @@ function requireWithContext(code, context) { return contextWithExports.module.exports; } -function runCodeSplitTest(codeMap, t, configContext = {}) { +function runCodeSplitTest(codeMap, t, entryName = 'main.js', configContext = {}) { const requireFromOutputVia = (importer) => (importee) => { const outputId = path.posix.join(path.posix.dirname(importer), importee); const code = codeMap[outputId]; @@ -42,8 +42,6 @@ function runCodeSplitTest(codeMap, t, configContext = {}) { return require(importee); }; - const chunkNames = Object.keys(codeMap); - const entryName = chunkNames.length === 1 ? chunkNames[0] : 'main.js'; if (!codeMap[entryName]) { throw new Error( `Could not find entry "${entryName}" in generated output.\nChunks:\n${Object.keys( @@ -56,7 +54,7 @@ function runCodeSplitTest(codeMap, t, configContext = {}) { let exports; try { exports = requireWithContext(codeMap[entryName], { - require: requireFromOutputVia('main.js'), + require: requireFromOutputVia(entryName), ...context }); } catch (error) { @@ -84,9 +82,9 @@ async function getCodeFromBundle(bundle, customOptions = {}) { return (await bundle.generate(options)).output[0].code; } -async function executeBundle(bundle, t, { context, exports } = {}) { +async function executeBundle(bundle, t, { context, exports, testEntry = 'main.js' } = {}) { const codeMap = await getCodeMapFromBundle(bundle, exports ? { exports } : {}); - return runCodeSplitTest(codeMap, t, context); + return runCodeSplitTest(codeMap, t, testEntry, context); } module.exports = { diff --git a/packages/commonjs/test/snapshots/function.js.md b/packages/commonjs/test/snapshots/function.js.md index c6e8d6b30..758c8aa3f 100644 --- a/packages/commonjs/test/snapshots/function.js.md +++ b/packages/commonjs/test/snapshots/function.js.md @@ -15,17 +15,24 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var foo$2 = {exports: {}};␊ + var foo$1 = {exports: {}};␊ + ␊ + var hasRequiredFoo;␊ ␊ - const foo = {};␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1.exports;␊ + hasRequiredFoo = 1;␊ + const foo = {};␊ ␊ - foo$2.exports = foo;␊ - foo$2.exports.bar = 1;␊ + foo$1.exports = foo;␊ + foo$1.exports.bar = 1;␊ + return foo$1.exports;␊ + }␊ ␊ - var fooExports = foo$2.exports;␊ - var foo$1 = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ + var fooExports = requireFoo();␊ + var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ ␊ - t.is(foo$1.bar, 1);␊ + t.is(foo.bar, 1);␊ `, } @@ -44,13 +51,20 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable */␊ ␊ - if (typeof document !== 'undefined') {␊ - document$2.exports = document;␊ - } else {␊ - document$2.exports = { fake: true };␊ + var hasRequiredDocument;␊ + ␊ + function requireDocument () {␊ + if (hasRequiredDocument) return document$2.exports;␊ + hasRequiredDocument = 1;␊ + if (typeof document !== 'undefined') {␊ + document$2.exports = document;␊ + } else {␊ + document$2.exports = { fake: true };␊ + }␊ + return document$2.exports;␊ }␊ ␊ - var documentExports = document$2.exports;␊ + var documentExports = requireDocument();␊ var document$1 = /*@__PURE__*/getDefaultExportFromCjs(documentExports);␊ ␊ t.deepEqual(document$1, { real: true });␊ @@ -64,7 +78,29 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - Math.bar = 42;␊ + var foo = {};␊ + ␊ + var bar = {};␊ + ␊ + var hasRequiredBar;␊ + ␊ + function requireBar () {␊ + if (hasRequiredBar) return bar;␊ + hasRequiredBar = 1;␊ + Math.bar = 42;␊ + return bar;␊ + }␊ + ␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + requireBar();␊ + return foo;␊ + }␊ + ␊ + requireFoo();␊ ␊ t.is(Math.bar, 42);␊ `, @@ -77,8 +113,30 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - // Great module␊ - Math.bar = 42;␊ + var foo = {};␊ + ␊ + var bar = {};␊ + ␊ + var hasRequiredBar;␊ + ␊ + function requireBar () {␊ + if (hasRequiredBar) return bar;␊ + hasRequiredBar = 1;␊ + // Great module␊ + Math.bar = 42;␊ + return bar;␊ + }␊ + ␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + requireBar();␊ + return foo;␊ + }␊ + ␊ + requireFoo();␊ ␊ t.is(Math.bar, 42);␊ `, @@ -95,15 +153,32 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var foo$1 = 21;␊ + var foo;␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo = 21;␊ + return foo;␊ + }␊ + ␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - const foo = foo$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ ␊ - var main = foo * 2;␊ + main$1 = foo * 2;␊ + return main$1;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = main$1;␊ + module.exports = main;␊ `, } @@ -114,13 +189,32 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var platform$1 = {};␊ + var main$1 = {};␊ + ␊ + var platform = {};␊ + ␊ + var hasRequiredPlatform;␊ + ␊ + function requirePlatform () {␊ + if (hasRequiredPlatform) return platform;␊ + hasRequiredPlatform = 1;␊ + platform.use = (platform$1) => (platform.platform = platform$1);␊ + return platform;␊ + }␊ ␊ - platform$1.use = (platform) => (platform$1.platform = platform);␊ + var browser;␊ + var hasRequiredBrowser;␊ ␊ - var browser$1 = 'browser';␊ + function requireBrowser () {␊ + if (hasRequiredBrowser) return browser;␊ + hasRequiredBrowser = 1;␊ + browser = 'browser';␊ + return browser;␊ + }␊ ␊ var proxy = {};␊ ␊ @@ -129,19 +223,29 @@ Generated by [AVA](https://avajs.dev). function requireProxy () {␊ if (hasRequiredProxy) return proxy;␊ hasRequiredProxy = 1;␊ - const { platform } = platform$1;␊ + const { platform } = requirePlatform();␊ ␊ t.is(platform, 'browser');␊ return proxy;␊ }␊ ␊ - // simplified from dd-trace␊ - const platform = platform$1;␊ - const browser = browser$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + // simplified from dd-trace␊ + const platform = requirePlatform();␊ + const browser = requireBrowser();␊ + ␊ + platform.use(browser);␊ ␊ - platform.use(browser);␊ + requireProxy();␊ + return main$1;␊ + }␊ ␊ - requireProxy();␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -227,15 +331,37 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var _export = {␊ - test: 42␊ - };␊ + var main$1 = {};␊ + ␊ + var _export;␊ + var hasRequired_export;␊ + ␊ + function require_export () {␊ + if (hasRequired_export) return _export;␊ + hasRequired_export = 1;␊ + _export = {␊ + test: 42␊ + };␊ + return _export;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const { test } = require_export();␊ ␊ - const { test } = _export;␊ + t.is(test, 42);␊ + return main$1;␊ + }␊ ␊ - t.is(test, 42);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -248,20 +374,31 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - Object.defineProperty(exports, '__esModule', { value: true });␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var main = {};␊ + var main$1 = {};␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + class Rollup {␊ + define;␊ + require;␊ + global;␊ + }␊ ␊ - class Rollup {␊ - define;␊ - require;␊ - global;␊ + main$1.Rollup = Rollup;␊ + return main$1;␊ }␊ ␊ - var Rollup_1 = main.Rollup = Rollup;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - exports.Rollup = Rollup_1;␊ - exports.default = main;␊ + module.exports = main;␊ `, } @@ -272,9 +409,22 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var _default = 'default';␊ + var dep$1 = {};␊ + ␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + dep$1.default = 'default';␊ + dep$1.named = 'named';␊ + return dep$1;␊ + }␊ + ␊ + var depExports = requireDep();␊ + var dep = depExports.default;␊ ␊ - t.is(_default, 'default');␊ + t.is(dep, 'default');␊ `, } @@ -287,7 +437,11 @@ Generated by [AVA](https://avajs.dev). ␊ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var dep = {};␊ ␊ @@ -310,13 +464,23 @@ Generated by [AVA](https://avajs.dev). return dep;␊ }␊ ␊ - commonjsGlobal.false = false;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + commonjsGlobal.false = false;␊ ␊ - if (commonjsGlobal.false) {␊ - // eslint-disable-next-line global-require␊ - requireDep();␊ + if (commonjsGlobal.false) {␊ + // eslint-disable-next-line global-require␊ + requireDep();␊ + }␊ + return main$1;␊ }␊ ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ module.exports = main;␊ `, } @@ -361,15 +525,24 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 { - 'bundle.js': `'use strict';␊ + 'main.js': `'use strict';␊ ␊ function getDefaultExportFromCjs (x) {␊ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var dashName = true;␊ + var dashName;␊ + var hasRequiredDashName;␊ ␊ - var value = /*@__PURE__*/getDefaultExportFromCjs(dashName);␊ + function requireDashName () {␊ + if (hasRequiredDashName) return dashName;␊ + hasRequiredDashName = 1;␊ + dashName = true;␊ + return dashName;␊ + }␊ + ␊ + var dashNameExports = requireDashName();␊ + var value = /*@__PURE__*/getDefaultExportFromCjs(dashNameExports);␊ ␊ t.truthy(value);␊ `, @@ -382,15 +555,33 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var someValue$1 = {};␊ + var deconflictExportAndLocal = {};␊ + ␊ + var someValue = {};␊ + ␊ + var hasRequiredSomeValue;␊ ␊ - someValue$1.someValue = 10;␊ + function requireSomeValue () {␊ + if (hasRequiredSomeValue) return someValue;␊ + hasRequiredSomeValue = 1;␊ + someValue.someValue = 10;␊ + return someValue;␊ + }␊ + ␊ + var hasRequiredDeconflictExportAndLocal;␊ ␊ - const someValueModule = someValue$1;␊ + function requireDeconflictExportAndLocal () {␊ + if (hasRequiredDeconflictExportAndLocal) return deconflictExportAndLocal;␊ + hasRequiredDeconflictExportAndLocal = 1;␊ + const someValueModule = requireSomeValue();␊ + ␊ + deconflictExportAndLocal.someValue = someValueModule.someValue;␊ + return deconflictExportAndLocal;␊ + }␊ ␊ - var someValue = someValueModule.someValue;␊ + var deconflictExportAndLocalExports = requireDeconflictExportAndLocal();␊ ␊ - t.is(someValue, 10);␊ + t.is(deconflictExportAndLocalExports.someValue, 10);␊ `, } @@ -401,13 +592,35 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var foo_bar;␊ + var hasRequiredFoo_bar;␊ + ␊ + function requireFoo_bar () {␊ + if (hasRequiredFoo_bar) return foo_bar;␊ + hasRequiredFoo_bar = 1;␊ + foo_bar = 'fubar';␊ + return foo_bar;␊ + }␊ + ␊ + var hasRequiredMain;␊ ␊ - var foo_bar = 'fubar';␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const status = requireFoo_bar();␊ ␊ - const status = foo_bar;␊ + t.is(status, 'fubar');␊ + return main$1;␊ + }␊ ␊ - t.is(status, 'fubar');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -420,10 +633,24 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var dep = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var dep$1 = {};␊ ␊ - dep.foo = 'first';␊ - dep.foo = 'second';␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + dep$1.foo = 'first';␊ + dep$1.foo = 'second';␊ + return dep$1;␊ + }␊ + ␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ ␊ t.is(dep.foo, 'second');␊ `, @@ -436,10 +663,21 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var foo = 'first';␊ - foo = 'second';␊ + var dep = {};␊ + ␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep.foo = 'first';␊ + dep.foo = 'second';␊ + return dep;␊ + }␊ + ␊ + var depExports = requireDep();␊ ␊ - t.is(foo, 'second');␊ + t.is(depExports.foo, 'second');␊ `, } @@ -454,12 +692,21 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var dep = 'first';␊ - dep = 'second';␊ + var dep$1;␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + dep$1 = 'first';␊ + dep$1 = 'second';␊ + return dep$1;␊ + }␊ ␊ - var dep$1 = /*@__PURE__*/getDefaultExportFromCjs(dep);␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ ␊ - t.is(dep$1, 'second');␊ + t.is(dep, 'second');␊ `, } @@ -474,17 +721,24 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var x$2 = {exports: {}};␊ + var x$1 = {exports: {}};␊ + ␊ + var hasRequiredX;␊ ␊ - const x = {};␊ + function requireX () {␊ + if (hasRequiredX) return x$1.exports;␊ + hasRequiredX = 1;␊ + const x = {};␊ ␊ - x$2.exports = x;␊ - x$2.exports.default = x;␊ + x$1.exports = x;␊ + x$1.exports.default = x;␊ + return x$1.exports;␊ + }␊ ␊ - var xExports = x$2.exports;␊ - var x$1 = /*@__PURE__*/getDefaultExportFromCjs(xExports);␊ + var xExports = requireX();␊ + var x = /*@__PURE__*/getDefaultExportFromCjs(xExports);␊ ␊ - t.is(x$1.default, x$1);␊ + t.is(x.default, x);␊ `, } @@ -499,17 +753,24 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var x$2 = {exports: {}};␊ + var x$1 = {exports: {}};␊ + ␊ + var hasRequiredX;␊ ␊ - const x = {};␊ + function requireX () {␊ + if (hasRequiredX) return x$1.exports;␊ + hasRequiredX = 1;␊ + const x = {};␊ ␊ - x$2.exports = x;␊ - x$2.exports.default = 42;␊ + x$1.exports = x;␊ + x$1.exports.default = 42;␊ + return x$1.exports;␊ + }␊ ␊ - var xExports = x$2.exports;␊ - var x$1 = /*@__PURE__*/getDefaultExportFromCjs(xExports);␊ + var xExports = requireX();␊ + var x = /*@__PURE__*/getDefaultExportFromCjs(xExports);␊ ␊ - t.deepEqual(x$1, { default: 42 });␊ + t.deepEqual(x, { default: 42 });␊ `, } @@ -520,24 +781,38 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var exports$1 = {};␊ ␊ - var Foo = exports$1.Foo = 1;␊ - var _var = exports$1.var = 'VAR';␊ - exports$1.default = {␊ - Foo: 2,␊ - default: 3␊ - };␊ + var hasRequiredExports;␊ + ␊ + function requireExports () {␊ + if (hasRequiredExports) return exports$1;␊ + hasRequiredExports = 1;␊ + exports$1.Foo = 1;␊ + exports$1.var = 'VAR';␊ + exports$1.default = {␊ + Foo: 2,␊ + default: 3␊ + };␊ + return exports$1;␊ + }␊ + ␊ + var exportsExports = requireExports();␊ + var E = /*@__PURE__*/getDefaultExportFromCjs(exportsExports);␊ ␊ /* 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');␊ + t.is(E.Foo, 1);␊ + t.is(E.var, 'VAR');␊ + t.deepEqual(E.default, { Foo: 2, default: 3 });␊ + t.is(E.default.Foo, 2);␊ + t.is(E.default.default, 3);␊ + t.is(exportsExports.Foo, 1);␊ + t.is(exportsExports.var, 'VAR');␊ `, } @@ -548,6 +823,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule;␊ var hasRequiredSubmodule;␊ ␊ @@ -652,24 +931,34 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - let message;␊ + var hasRequiredMain;␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-module-require")(\`./${withName}\`);␊ - }␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + let message;␊ + ␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-module-require")(\`./${withName}\`);␊ + }␊ + ␊ + try {␊ + const submodule = takeModule('submodule');␊ + message = submodule();␊ + } catch (err) {␊ + ({ message } = err);␊ + }␊ ␊ - try {␊ - const submodule = takeModule('submodule');␊ - message = submodule();␊ - } catch (err) {␊ - ({ message } = err);␊ + t.is(message, 'Hello there');␊ + return main$1;␊ }␊ ␊ - t.is(message, 'Hello there');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -682,6 +971,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule;␊ var hasRequiredSubmodule;␊ ␊ @@ -786,24 +1079,34 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - let message;␊ + var hasRequiredMain;␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require")(\`./${withName}\`);␊ - }␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + let message;␊ + ␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require")(\`./${withName}\`);␊ + }␊ + ␊ + try {␊ + const submodule = takeModule('submodule');␊ + message = submodule();␊ + } catch (err) {␊ + ({ message } = err);␊ + }␊ ␊ - try {␊ - const submodule = takeModule('submodule');␊ - message = submodule();␊ - } catch (err) {␊ - ({ message } = err);␊ + t.is(message, 'Hello there');␊ + return main$1;␊ }␊ ␊ - t.is(message, 'Hello there');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -816,7 +1119,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var direct;␊ var hasRequiredDirect;␊ @@ -946,21 +1253,38 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-absolute-import/sub")(name);␊ - }␊ + var hasRequiredSubmodule;␊ ␊ - submodule.moduleDirect = takeModule('module/direct');␊ - submodule.moduleNested = takeModule('module/nested/nested');␊ - submodule.parentModule = takeModule('parent-module/parent');␊ + function requireSubmodule () {␊ + if (hasRequiredSubmodule) return submodule;␊ + hasRequiredSubmodule = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-absolute-import/sub")(name);␊ + }␊ + ␊ + submodule.moduleDirect = takeModule('module/direct');␊ + submodule.moduleNested = takeModule('module/nested/nested');␊ + submodule.parentModule = takeModule('parent-module/parent');␊ + return submodule;␊ + }␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - t.deepEqual(submodule, {␊ - moduleDirect: 'direct',␊ - moduleNested: 'nested',␊ - parentModule: 'parent'␊ - });␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.deepEqual(requireSubmodule(), {␊ + moduleDirect: 'direct',␊ + moduleNested: 'nested',␊ + parentModule: 'parent'␊ + });␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -979,6 +1303,10 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var stub;␊ var hasRequiredStub;␊ ␊ @@ -1083,18 +1411,28 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable global-require */␊ ␊ - // noinspection UnnecessaryLocalVariableJS␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + // noinspection UnnecessaryLocalVariableJS␊ + ␊ + // A hack used in many old libraries, saying "workaround to exclude package from browserify list."␊ + // Will bypass rollup-commonjs finding out that this is a require that should not go through the plugin, and will do an infinite search.␊ + const _require = createCommonjsRequire("/fixtures/function/dynamic-require-alias-hack");␊ + const buffer = _require('buffer');␊ ␊ - // A hack used in many old libraries, saying "workaround to exclude package from browserify list."␊ - // Will bypass rollup-commonjs finding out that this is a require that should not go through the plugin, and will do an infinite search.␊ - const _require = createCommonjsRequire("/fixtures/function/dynamic-require-alias-hack");␊ - const buffer = _require('buffer');␊ + t.is(buffer, require$$0__default.default);␊ + return main$1;␊ + }␊ ␊ - t.is(buffer, require$$0__default.default);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -1109,18 +1447,29 @@ Generated by [AVA](https://avajs.dev). ␊ var main2 = require('./main2.js');␊ ␊ + var lib1 = {};␊ + ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - let message;␊ + var hasRequiredLib1;␊ ␊ - for (const index of [1, 2]) {␊ - try {␊ - message = main2.createCommonjsRequire("/fixtures/function/dynamic-require-code-splitting")(\`./target${index}.js\`);␊ - } catch (err) {␊ - ({ message } = err);␊ - }␊ - t.is(message, index.toString());␊ + function requireLib1 () {␊ + if (hasRequiredLib1) return lib1;␊ + hasRequiredLib1 = 1;␊ + let message;␊ + ␊ + for (const index of [1, 2]) {␊ + try {␊ + message = main2.createCommonjsRequire("/fixtures/function/dynamic-require-code-splitting")(\`./target${index}.js\`);␊ + } catch (err) {␊ + ({ message } = err);␊ + }␊ + t.is(message, index.toString());␊ + }␊ + return lib1;␊ }␊ + ␊ + requireLib1();␊ `, 'main2.js': `'use strict';␊ ␊ @@ -1237,19 +1586,30 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ + var lib2 = {};␊ + ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - let message;␊ + var hasRequiredLib2;␊ + ␊ + function requireLib2 () {␊ + if (hasRequiredLib2) return lib2;␊ + hasRequiredLib2 = 1;␊ + let message;␊ ␊ - for (const index of [1, 2]) {␊ - try {␊ - message = createCommonjsRequire("/fixtures/function/dynamic-require-code-splitting")(\`./target${index}.js\`);␊ - } catch (err) {␊ - ({ message } = err);␊ - }␊ - t.is(message, index.toString());␊ + for (const index of [1, 2]) {␊ + try {␊ + message = createCommonjsRequire("/fixtures/function/dynamic-require-code-splitting")(\`./target${index}.js\`);␊ + } catch (err) {␊ + ({ message } = err);␊ + }␊ + t.is(message, index.toString());␊ + }␊ + return lib2;␊ }␊ ␊ + requireLib2();␊ + ␊ exports.createCommonjsRequire = createCommonjsRequire;␊ `, } @@ -1288,6 +1648,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule = {};␊ ␊ var hasRequiredSubmodule;␊ @@ -1391,15 +1755,25 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-empty")(\`./${withName}\`);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-empty")(\`./${withName}\`);␊ + }␊ + ␊ + t.deepEqual(takeModule('submodule'), {});␊ + return main$1;␊ }␊ ␊ - t.deepEqual(takeModule('submodule'), {});␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -1520,13 +1894,22 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-es-entry")(\`./${withName}\`);␊ - }␊ + var importer;␊ + var hasRequiredImporter;␊ + ␊ + function requireImporter () {␊ + if (hasRequiredImporter) return importer;␊ + hasRequiredImporter = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-es-entry")(\`./${withName}\`);␊ + }␊ ␊ - var importer = takeModule('submodule.js');␊ + importer = takeModule('submodule.js');␊ + return importer;␊ + }␊ ␊ - var result = /*@__PURE__*/getDefaultExportFromCjs(importer);␊ + var importerExports = requireImporter();␊ + var result = /*@__PURE__*/getDefaultExportFromCjs(importerExports);␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ @@ -1574,6 +1957,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule;␊ var hasRequiredSubmodule;␊ ␊ @@ -1676,23 +2063,33 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-extensions")(\`./${withName}\`);␊ - }␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-extensions")(\`./${withName}\`);␊ + }␊ ␊ - const withExtension = takeModule('submodule.js');␊ - const withoutExtension = takeModule('submodule');␊ + const withExtension = takeModule('submodule.js');␊ + const withoutExtension = takeModule('submodule');␊ ␊ - t.is(withExtension.name, 'submodule');␊ - t.is(withoutExtension.name, 'submodule');␊ + t.is(withExtension.name, 'submodule');␊ + t.is(withoutExtension.name, 'submodule');␊ ␊ - withExtension.value = 'mutated';␊ + withExtension.value = 'mutated';␊ + ␊ + t.is(withoutExtension.value, 'mutated');␊ + return main$1;␊ + }␊ ␊ - t.is(withoutExtension.value, 'mutated');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -1705,16 +2102,30 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return require(withName);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return require(withName);␊ + }␊ + ␊ + // The bundled code will run from test/helpers/util.js␊ + t.is(takeModule('../fixtures/function/dynamic-require-fallback/dep.js'), 'dep');␊ + return main$1;␊ }␊ ␊ - // The bundled code will run from test/helpers/util.js␊ - t.is(takeModule('../fixtures/function/dynamic-require-fallback/dep.js'), 'dep');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -1755,6 +2166,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule1;␊ var hasRequiredSubmodule1;␊ ␊ @@ -1879,21 +2294,31 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-globs")(\`./${withName}\`);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-globs")(\`./${withName}\`);␊ + }␊ + ␊ + t.is(takeModule('submodule1.js'), 'submodule1');␊ + t.is(takeModule('submodule2.js'), 'submodule2');␊ + t.is(takeModule('extramodule1.js'), 'extramodule1');␊ + t.throws(() => takeModule('extramodule2.js'), {␊ + message:␊ + 'Could not dynamically require "./extramodule2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊ + });␊ + return main$1;␊ }␊ ␊ - t.is(takeModule('submodule1.js'), 'submodule1');␊ - t.is(takeModule('submodule2.js'), 'submodule2');␊ - t.is(takeModule('extramodule1.js'), 'extramodule1');␊ - t.throws(() => takeModule('extramodule2.js'), {␊ - message:␊ - 'Could not dynamically require "./extramodule2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊ - });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -1906,6 +2331,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var direct;␊ var hasRequiredDirect;␊ ␊ @@ -1916,14 +2345,14 @@ Generated by [AVA](https://avajs.dev). return direct;␊ }␊ ␊ - var main$1;␊ - var hasRequiredMain;␊ + var main$2;␊ + var hasRequiredMain$1;␊ ␊ - function requireMain () {␊ - if (hasRequiredMain) return main$1;␊ - hasRequiredMain = 1;␊ - main$1 = { name: 'package', value: null };␊ - return main$1;␊ + function requireMain$1 () {␊ + if (hasRequiredMain$1) return main$2;␊ + hasRequiredMain$1 = 1;␊ + main$2 = { name: 'package', value: null };␊ + return main$2;␊ }␊ ␊ var dynamicModules;␊ @@ -1932,8 +2361,8 @@ Generated by [AVA](https://avajs.dev). return dynamicModules || (dynamicModules = {␊ "/fixtures/function/dynamic-require-instances/direct": requireDirect,␊ "/fixtures/function/dynamic-require-instances/direct/index.js": requireDirect,␊ - "/fixtures/function/dynamic-require-instances/package": requireMain,␊ - "/fixtures/function/dynamic-require-instances/package/main.js": requireMain␊ + "/fixtures/function/dynamic-require-instances/package": requireMain$1,␊ + "/fixtures/function/dynamic-require-instances/package/main.js": requireMain$1␊ });␊ }␊ ␊ @@ -2021,21 +2450,31 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-instances")(withName);␊ - }␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-instances")(withName);␊ + }␊ ␊ - takeModule('./direct').value = 'direct-instance';␊ - t.is(takeModule('./direct/index.js').value, 'direct-instance');␊ - t.is(requireDirect().value, 'direct-instance');␊ + takeModule('./direct').value = 'direct-instance';␊ + t.is(takeModule('./direct/index.js').value, 'direct-instance');␊ + t.is(requireDirect().value, 'direct-instance');␊ ␊ - takeModule('./package').value = 'package-instance';␊ - t.is(takeModule('./package/main.js').value, 'package-instance');␊ - t.is(requireMain().value, 'package-instance');␊ + takeModule('./package').value = 'package-instance';␊ + t.is(takeModule('./package/main.js').value, 'package-instance');␊ + t.is(requireMain$1().value, 'package-instance');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2048,6 +2487,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var value = "present";␊ var json0 = {␊ value: value␊ @@ -2145,16 +2588,26 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-json")(\`./${withName}\`);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-json")(\`./${withName}\`);␊ + }␊ + ␊ + t.deepEqual(takeModule('dynamic.json'), { value: 'present' });␊ + t.deepEqual(takeModule('dynamic'), { value: 'present' });␊ + return main$1;␊ }␊ ␊ - t.deepEqual(takeModule('dynamic.json'), { value: 'present' });␊ - t.deepEqual(takeModule('dynamic'), { value: 'present' });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2167,22 +2620,36 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function commonjsRequire(path) {␊ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return commonjsRequire(withName);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return commonjsRequire(withName);␊ + }␊ + ␊ + t.throws(() => takeModule('./dep.js'), {␊ + message:␊ + 'Could not dynamically require "./dep.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊ + });␊ + return main$1;␊ }␊ ␊ - t.throws(() => takeModule('./dep.js'), {␊ - message:␊ - 'Could not dynamically require "./dep.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊ - });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2195,6 +2662,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var entry$2;␊ var hasRequiredEntry$2;␊ ␊ @@ -2322,33 +2793,51 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule$1(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-package/sub")(name);␊ - }␊ + var sub;␊ + var hasRequiredSub;␊ ␊ - var sub = {␊ - parent: takeModule$1('..'),␊ - customModule: takeModule$1('custom-module')␊ - };␊ + function requireSub () {␊ + if (hasRequiredSub) return sub;␊ + hasRequiredSub = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-package/sub")(name);␊ + }␊ + ␊ + sub = {␊ + parent: takeModule('..'),␊ + customModule: takeModule('custom-module')␊ + };␊ + return sub;␊ + }␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-package")(name);␊ - }␊ + var hasRequiredMain;␊ ␊ - t.is(takeModule('.'), 'same-directory');␊ - t.is(takeModule('./'), 'same-directory');␊ - t.is(takeModule('.//'), 'same-directory');␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-package")(name);␊ + }␊ ␊ - t.is(takeModule('./sub'), 'sub');␊ + t.is(takeModule('.'), 'same-directory');␊ + t.is(takeModule('./'), 'same-directory');␊ + t.is(takeModule('.//'), 'same-directory');␊ + ␊ + t.is(takeModule('./sub'), 'sub');␊ + ␊ + t.is(takeModule('custom-module'), 'custom-module');␊ + t.deepEqual(requireSub(), { parent: 'same-directory', customModule: 'custom-module' });␊ + return main$1;␊ + }␊ ␊ - t.is(takeModule('custom-module'), 'custom-module');␊ - t.deepEqual(sub, { parent: 'same-directory', customModule: 'custom-module' });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2359,9 +2848,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 { - 'entry.js': `'use strict';␊ + 'main.js': `'use strict';␊ ␊ - var entry$1 = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var entry;␊ var hasRequiredEntry;␊ @@ -2373,9 +2866,19 @@ Generated by [AVA](https://avajs.dev). return entry;␊ }␊ ␊ - t.is(requireEntry(), 'custom-module');␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.is(requireEntry(), 'custom-module');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = entry$1;␊ + module.exports = main;␊ `, } @@ -2386,6 +2889,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule;␊ var hasRequiredSubmodule;␊ ␊ @@ -2499,18 +3006,28 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModuleWithDelimiter(name, delimiter) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-relative-paths")(\`.${delimiter}${name.replace(/=/g, delimiter)}\`);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModuleWithDelimiter(name, delimiter) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-relative-paths")(\`.${delimiter}${name.replace(/=/g, delimiter)}\`);␊ + }␊ + ␊ + 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');␊ + return main$1;␊ }␊ ␊ - 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');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2523,6 +3040,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var dynamicRequireResolveIndex;␊ var hasRequiredDynamicRequireResolveIndex;␊ ␊ @@ -2534,11 +3055,11 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ var sub$1;␊ - var hasRequiredSub;␊ + var hasRequiredSub$1;␊ ␊ - function requireSub () {␊ - if (hasRequiredSub) return sub$1;␊ - hasRequiredSub = 1;␊ + function requireSub$1 () {␊ + if (hasRequiredSub$1) return sub$1;␊ + hasRequiredSub$1 = 1;␊ sub$1 = 'sub';␊ return sub$1;␊ }␊ @@ -2559,8 +3080,8 @@ Generated by [AVA](https://avajs.dev). return dynamicModules || (dynamicModules = {␊ "/fixtures/function/dynamic-require-resolve-index": requireDynamicRequireResolveIndex,␊ "/fixtures/function/dynamic-require-resolve-index/index.js": requireDynamicRequireResolveIndex,␊ - "/fixtures/function/dynamic-require-resolve-index/sub": requireSub,␊ - "/fixtures/function/dynamic-require-resolve-index/sub/index.js": requireSub,␊ + "/fixtures/function/dynamic-require-resolve-index/sub": requireSub$1,␊ + "/fixtures/function/dynamic-require-resolve-index/sub/index.js": requireSub$1,␊ "/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module": requireCustomModule,␊ "/fixtures/function/dynamic-require-resolve-index/node_modules/custom-module/index.js": requireCustomModule␊ });␊ @@ -2650,33 +3171,51 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule$1(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-resolve-index/sub")(name);␊ - }␊ + var sub;␊ + var hasRequiredSub;␊ ␊ - var sub = {␊ - parent: takeModule$1('..'),␊ - customModule: takeModule$1('custom-module')␊ - };␊ + function requireSub () {␊ + if (hasRequiredSub) return sub;␊ + hasRequiredSub = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-resolve-index/sub")(name);␊ + }␊ ␊ - /* eslint-disable import/no-dynamic-require, global-require */␊ - ␊ - function takeModule(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-resolve-index")(name);␊ + sub = {␊ + parent: takeModule('..'),␊ + customModule: takeModule('custom-module')␊ + };␊ + return sub;␊ }␊ ␊ - t.is(takeModule('.'), 'same-directory');␊ - t.is(takeModule('./'), 'same-directory');␊ - t.is(takeModule('.//'), 'same-directory');␊ + /* eslint-disable import/no-dynamic-require, global-require */␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-resolve-index")(name);␊ + }␊ + ␊ + t.is(takeModule('.'), 'same-directory');␊ + t.is(takeModule('./'), 'same-directory');␊ + t.is(takeModule('.//'), 'same-directory');␊ + ␊ + t.is(takeModule('./sub'), 'sub');␊ ␊ - t.is(takeModule('./sub'), 'sub');␊ + t.is(takeModule('custom-module'), 'custom-module');␊ + t.deepEqual(requireSub(), { parent: 'same-directory', customModule: 'custom-module' });␊ + return main$1;␊ + }␊ ␊ - t.is(takeModule('custom-module'), 'custom-module');␊ - t.deepEqual(sub, { parent: 'same-directory', customModule: 'custom-module' });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2689,7 +3228,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var customModule2;␊ var hasRequiredCustomModule2;␊ @@ -2806,14 +3349,24 @@ Generated by [AVA](https://avajs.dev). return customModule;␊ }␊ ␊ - t.is(␊ - requireCustomModule()(),␊ - '/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2'␊ - );␊ - t.is(␊ - requireCustomModule2()(),␊ - '/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module'␊ - );␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.is(␊ + requireCustomModule()(),␊ + '/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module2'␊ + );␊ + t.is(␊ + requireCustomModule2()(),␊ + '/fixtures/function/dynamic-require-resolve-reference/node_modules/custom-module'␊ + );␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2826,6 +3379,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var submodule;␊ var hasRequiredSubmodule;␊ ␊ @@ -2930,24 +3487,34 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - let message;␊ + var hasRequiredMain;␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/")(\`./${withName}\`);␊ - }␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + let message;␊ + ␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/")(\`./${withName}\`);␊ + }␊ + ␊ + try {␊ + const submodule = takeModule('submodule');␊ + message = submodule();␊ + } catch (err) {␊ + ({ message } = err);␊ + }␊ ␊ - try {␊ - const submodule = takeModule('submodule');␊ - message = submodule();␊ - } catch (err) {␊ - ({ message } = err);␊ + t.is(message, 'Hello there');␊ + return main$1;␊ }␊ ␊ - t.is(message, 'Hello there');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -2960,7 +3527,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var customModule = {exports: {}};␊ ␊ @@ -3006,11 +3577,21 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - const custom = requireCustomModule();␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const custom = requireCustomModule();␊ + ␊ + t.is(custom.get1(), 'all good');␊ + t.is(custom.get2(), 'indirect ref');␊ + t.is(custom.get3(), custom.get1());␊ + return main$1;␊ + }␊ ␊ - t.is(custom.get1(), 'all good');␊ - t.is(custom.get2(), 'indirect ref');␊ - t.is(custom.get3(), custom.get1());␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3023,6 +3604,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var dynamicRequireSlashAccess;␊ var hasRequiredDynamicRequireSlashAccess;␊ ␊ @@ -3034,21 +3619,21 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ var sub$2;␊ - var hasRequiredSub$1;␊ + var hasRequiredSub$2;␊ ␊ - function requireSub$1 () {␊ - if (hasRequiredSub$1) return sub$2;␊ - hasRequiredSub$1 = 1;␊ + function requireSub$2 () {␊ + if (hasRequiredSub$2) return sub$2;␊ + hasRequiredSub$2 = 1;␊ sub$2 = 'sub';␊ return sub$2;␊ }␊ ␊ var sub$1;␊ - var hasRequiredSub;␊ + var hasRequiredSub$1;␊ ␊ - function requireSub () {␊ - if (hasRequiredSub) return sub$1;␊ - hasRequiredSub = 1;␊ + function requireSub$1 () {␊ + if (hasRequiredSub$1) return sub$1;␊ + hasRequiredSub$1 = 1;␊ sub$1 = 'sub';␊ return sub$1;␊ }␊ @@ -3059,7 +3644,7 @@ Generated by [AVA](https://avajs.dev). function requireCustomModule () {␊ if (hasRequiredCustomModule) return customModule;␊ hasRequiredCustomModule = 1;␊ - customModule = 'custom-module' + ' + ' + requireSub();␊ + customModule = 'custom-module' + ' + ' + requireSub$1();␊ return customModule;␊ }␊ ␊ @@ -3069,11 +3654,11 @@ Generated by [AVA](https://avajs.dev). return dynamicModules || (dynamicModules = {␊ "/fixtures/function/dynamic-require-slash-access": requireDynamicRequireSlashAccess,␊ "/fixtures/function/dynamic-require-slash-access/index.js": requireDynamicRequireSlashAccess,␊ - "/fixtures/function/dynamic-require-slash-access/sub": requireSub$1,␊ - "/fixtures/function/dynamic-require-slash-access/sub/index.js": requireSub$1,␊ + "/fixtures/function/dynamic-require-slash-access/sub": requireSub$2,␊ + "/fixtures/function/dynamic-require-slash-access/sub/index.js": requireSub$2,␊ "/fixtures/function/dynamic-require-slash-access/node_modules/custom-module": requireCustomModule,␊ "/fixtures/function/dynamic-require-slash-access/node_modules/custom-module/index.js": requireCustomModule,␊ - "/fixtures/function/dynamic-require-slash-access/node_modules/custom-module2/sub.js": requireSub␊ + "/fixtures/function/dynamic-require-slash-access/node_modules/custom-module2/sub.js": requireSub$1␊ });␊ }␊ ␊ @@ -3161,36 +3746,54 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule$1(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-slash-access/sub")(name);␊ - }␊ + var sub;␊ + var hasRequiredSub;␊ ␊ - var sub = {␊ - parent: takeModule$1('..'),␊ - customModule: takeModule$1('custom-module')␊ - };␊ + function requireSub () {␊ + if (hasRequiredSub) return sub;␊ + hasRequiredSub = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-slash-access/sub")(name);␊ + }␊ + ␊ + sub = {␊ + parent: takeModule('..'),␊ + customModule: takeModule('custom-module')␊ + };␊ + return sub;␊ + }␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(name) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-slash-access")(name);␊ - }␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(name) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-slash-access")(name);␊ + }␊ ␊ - t.is(takeModule('.'), 'same-directory', '.');␊ - t.is(takeModule('./'), 'same-directory', './');␊ - t.is(takeModule('.//'), 'same-directory', './/');␊ + t.is(takeModule('.'), 'same-directory', '.');␊ + t.is(takeModule('./'), 'same-directory', './');␊ + t.is(takeModule('.//'), 'same-directory', './/');␊ ␊ - t.is(takeModule('./sub'), 'sub', './sub');␊ + t.is(takeModule('./sub'), 'sub', './sub');␊ ␊ - t.is(takeModule('custom-module'), 'custom-module + sub', 'custom-module');␊ - t.deepEqual(sub, {␊ - parent: 'same-directory',␊ - customModule: 'custom-module + sub'␊ - });␊ + t.is(takeModule('custom-module'), 'custom-module + sub', 'custom-module');␊ + t.deepEqual(requireSub(), {␊ + parent: 'same-directory',␊ + customModule: 'custom-module + sub'␊ + });␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3203,6 +3806,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var dep1;␊ var hasRequiredDep1;␊ ␊ @@ -3305,17 +3912,27 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-targets-fallback")(withName);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-targets-fallback")(withName);␊ + }␊ + ␊ + t.is(takeModule('./dep1.js'), 'dep');␊ + // The bundled code will run from test/helpers/util.js␊ + t.is(takeModule('../fixtures/function/dynamic-require-targets-fallback/dep2.js'), 'dep');␊ + return main$1;␊ }␊ ␊ - t.is(takeModule('./dep1.js'), 'dep');␊ - // The bundled code will run from test/helpers/util.js␊ - t.is(takeModule('../fixtures/function/dynamic-require-targets-fallback/dep2.js'), 'dep');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3328,6 +3945,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var dep1;␊ var hasRequiredDep1;␊ ␊ @@ -3430,19 +4051,29 @@ Generated by [AVA](https://avajs.dev). return path;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-dynamic-require, global-require */␊ ␊ - function takeModule(withName) {␊ - return createCommonjsRequire("/fixtures/function/dynamic-require-targets-no-fallback")(withName);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function takeModule(withName) {␊ + return createCommonjsRequire("/fixtures/function/dynamic-require-targets-no-fallback")(withName);␊ + }␊ + ␊ + t.is(takeModule('./dep1.js'), 'dep');␊ + t.throws(() => takeModule('./dep2.js'), {␊ + message:␊ + 'Could not dynamically require "./dep2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊ + });␊ + return main$1;␊ }␊ ␊ - t.is(takeModule('./dep1.js'), 'dep');␊ - t.throws(() => takeModule('./dep2.js'), {␊ - message:␊ - 'Could not dynamically require "./dep2.js". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'␊ - });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3503,19 +4134,33 @@ Generated by [AVA](https://avajs.dev). var require$$3__default = /*#__PURE__*/_interopDefaultCompat(require$$3);␊ var require$$4__default = /*#__PURE__*/_interopDefaultCompat(require$$4);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ - const externalExports = require$$0__default.default;␊ - const externalModuleExports = require$$1__default.default;␊ - const externalNamed = require$$2__default.default;␊ - const externalMixed = require$$3__default.default;␊ - const externalDefault = require$$4__default.default;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalExports = require$$0__default.default;␊ + const externalModuleExports = require$$1__default.default;␊ + const externalNamed = require$$2__default.default;␊ + const externalMixed = require$$3__default.default;␊ + const externalDefault = require$$4__default.default;␊ + ␊ + t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ + t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ + t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ + t.deepEqual(externalMixed, 'bar', 'external mixed');␊ + t.deepEqual(externalDefault, 'bar', 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ - t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ - t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ - t.deepEqual(externalMixed, 'bar', 'external mixed');␊ - t.deepEqual(externalDefault, 'bar', 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3560,6 +4205,10 @@ Generated by [AVA](https://avajs.dev). var require$$3__default = /*#__PURE__*/_interopDefaultCompat(require$$3);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -3585,21 +4234,31 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$4 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊ ␊ - const externalExports = require$$0__default.default;␊ - const externalModuleExports = require$$1__default.default;␊ - const externalNamed = require$$2__default.default;␊ - const externalMixed = require$$3__default.default;␊ - const externalDefault = require$$4;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalExports = require$$0__default.default;␊ + const externalModuleExports = require$$1__default.default;␊ + const externalNamed = require$$2__default.default;␊ + const externalMixed = require$$3__default.default;␊ + const externalDefault = require$$4;␊ + ␊ + t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ + t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ + t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ + t.deepEqual(externalMixed, 'bar', 'external mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ - t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ - t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ - t.deepEqual(externalMixed, 'bar', 'external mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3644,6 +4303,10 @@ Generated by [AVA](https://avajs.dev). var require$$3__default = /*#__PURE__*/_interopDefaultCompat(require$$3);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -3669,21 +4332,31 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$4 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊ ␊ - const externalExports = require$$0__default.default;␊ - const externalModuleExports = require$$1__default.default;␊ - const externalNamed = require$$2__default.default;␊ - const externalMixed = require$$3__default.default;␊ - const externalDefault = require$$4;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalExports = require$$0__default.default;␊ + const externalModuleExports = require$$1__default.default;␊ + const externalNamed = require$$2__default.default;␊ + const externalMixed = require$$3__default.default;␊ + const externalDefault = require$$4;␊ + ␊ + t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ + t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ + t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ + t.deepEqual(externalMixed, 'bar', 'external mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ - t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ - t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ - t.deepEqual(externalMixed, 'bar', 'external mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3722,6 +4395,10 @@ Generated by [AVA](https://avajs.dev). var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmMixed);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -3747,7 +4424,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊ ␊ @@ -3755,13 +4432,23 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊ ␊ - const externalNamed = require$$0;␊ - const externalMixed = require$$1;␊ - const externalDefault = require$$2;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0;␊ + const externalMixed = require$$1;␊ + const externalDefault = require$$2;␊ + ␊ + t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ + t.deepEqual(externalMixed, { default: 'bar', foo: 'foo' }, 'external mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ - t.deepEqual(externalMixed, { default: 'bar', foo: 'foo' }, 'external mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3788,19 +4475,33 @@ Generated by [AVA](https://avajs.dev). var require$$3__default = /*#__PURE__*/_interopDefaultCompat(require$$3);␊ var require$$4__default = /*#__PURE__*/_interopDefaultCompat(require$$4);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var hasRequiredMain;␊ ␊ - const externalExports = require$$0__default.default;␊ - const externalModuleExports = require$$1__default.default;␊ - const externalNamed = require$$2__default.default;␊ - const externalMixed = require$$3__default.default;␊ - const externalDefault = require$$4__default.default;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalExports = require$$0__default.default;␊ + const externalModuleExports = require$$1__default.default;␊ + const externalNamed = require$$2__default.default;␊ + const externalMixed = require$$3__default.default;␊ + const externalDefault = require$$4__default.default;␊ + ␊ + t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ + t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ + t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ + t.deepEqual(externalMixed, 'bar', 'external mixed');␊ + t.deepEqual(externalDefault, 'bar', 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(externalExports, { foo: 'foo' }, 'external exports');␊ - t.deepEqual(externalModuleExports, 'bar', 'external module exports');␊ - t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ - t.deepEqual(externalMixed, 'bar', 'external mixed');␊ - t.deepEqual(externalDefault, 'bar', 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3830,6 +4531,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -3855,9 +4560,9 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ - function foo$1(...args) {␊ + function foo(...args) {␊ return args;␊ }␊ ␊ @@ -3866,16 +4571,16 @@ Generated by [AVA](https://avajs.dev). var esmFunction = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ bar: bar$1,␊ - default: foo$1␊ + default: foo␊ });␊ ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(esmFunction);␊ ␊ - function Foo$1(...args) {␊ + function Foo(...args) {␊ this.foo = args;␊ }␊ ␊ - Foo$1.prototype.update = function () {␊ + Foo.prototype.update = function () {␊ this.foo = 'updated';␊ };␊ ␊ @@ -3884,30 +4589,40 @@ Generated by [AVA](https://avajs.dev). var esmConstructor = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ bar: bar,␊ - default: Foo$1␊ + default: Foo␊ });␊ ␊ var require$$1 = /*@__PURE__*/getAugmentedNamespace(esmConstructor);␊ ␊ - const foo = require$$0;␊ - const Foo = require$$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = require$$0;␊ + const Foo = require$$1;␊ + ␊ + t.is(foo.bar, 'bar');␊ + t.deepEqual(foo.default('first'), ['first']);␊ + t.deepEqual(foo('second'), ['second']);␊ ␊ - t.is(foo.bar, 'bar');␊ - t.deepEqual(foo.default('first'), ['first']);␊ - t.deepEqual(foo('second'), ['second']);␊ + t.is(Foo.bar, 'bar');␊ ␊ - t.is(Foo.bar, 'bar');␊ + // eslint-disable-next-line new-cap␊ + const newDefault = new Foo.default('third');␊ + t.deepEqual(newDefault.foo, ['third']);␊ + newDefault.update();␊ + t.is(newDefault.foo, 'updated');␊ ␊ - // eslint-disable-next-line new-cap␊ - const newDefault = new Foo.default('third');␊ - t.deepEqual(newDefault.foo, ['third']);␊ - newDefault.update();␊ - t.is(newDefault.foo, 'updated');␊ + const newFoo = new Foo('fourth');␊ + t.deepEqual(newFoo.foo, ['fourth']);␊ + newFoo.update();␊ + t.is(newFoo.foo, 'updated');␊ + return main$1;␊ + }␊ ␊ - const newFoo = new Foo('fourth');␊ - t.deepEqual(newFoo.foo, ['fourth']);␊ - newFoo.update();␊ - t.is(newFoo.foo, 'updated');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3920,6 +4635,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -3945,24 +4664,34 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ const foo = 'foo';␊ ␊ const __esModule = true;␊ ␊ - var esm$1 = /*#__PURE__*/Object.freeze({␊ + var esm = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ __esModule: __esModule,␊ foo: foo␊ });␊ ␊ - var require$$0 = /*@__PURE__*/getAugmentedNamespace(esm$1);␊ + var require$$0 = /*@__PURE__*/getAugmentedNamespace(esm);␊ ␊ - const esm = require$$0;␊ + var hasRequiredMain;␊ ␊ - t.is(esm.foo, 'foo');␊ - t.is(esm.__esModule, true);␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const esm = require$$0;␊ + ␊ + t.is(esm.foo, 'foo');␊ + t.is(esm.__esModule, true);␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -3975,14 +4704,28 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var require$$0 = 'default export';␊ ␊ - t.is(require$$0, 'default export');␊ + var hasRequiredMain;␊ ␊ - module.exports = main;␊ - `, + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.is(require$$0, 'default export');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ + `, } ## exports @@ -3998,17 +4741,33 @@ Generated by [AVA](https://avajs.dev). ␊ var foo = {};␊ ␊ - foo.bar = 'BAR';␊ - foo.baz = 'BAZ';␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo.bar = 'BAR';␊ + foo.baz = 'BAZ';␊ + return foo;␊ + }␊ + ␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - const { bar } = foo;␊ - const { baz } = foo;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const { bar } = requireFoo();␊ + const { baz } = requireFoo();␊ ␊ - var main = bar + baz;␊ + main$1 = bar + baz;␊ + return main$1;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = main$1;␊ + module.exports = main;␊ `, } @@ -4019,21 +4778,40 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {exports: {}};␊ + var main$1 = {};␊ + ␊ + var dep = {exports: {}};␊ + ␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep.exports;␊ + hasRequiredDep = 1;␊ + (function (module, exports) {␊ + exports.foo = 'foo';␊ + module.exports = { replaced: true };␊ + exports.bar = 'bar'; ␊ + } (dep, dep.exports));␊ + return dep.exports;␊ + }␊ ␊ - (function (module, exports) {␊ - exports.foo = 'foo';␊ - module.exports = { replaced: true };␊ - exports.bar = 'bar'; ␊ - } (dep$1, dep$1.exports));␊ + var hasRequiredMain;␊ ␊ - var depExports = dep$1.exports;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ ␊ - const dep = depExports;␊ + t.deepEqual(dep, { replaced: true });␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(dep, { replaced: true });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4046,21 +4824,40 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var other = require('./other.js');␊ + var other = require('./other-UXsUMMAz.js');␊ ␊ - t.is(other, 'foo');␊ + var otherExports = other.requireOther();␊ + var foo = /*@__PURE__*/other.getDefaultExportFromCjs(otherExports);␊ + ␊ + t.is(foo, 'foo');␊ `, - 'other.js': `'use strict';␊ + 'other-UXsUMMAz.js': `'use strict';␊ ␊ function getDefaultExportFromCjs (x) {␊ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var other = 'foo';␊ + var other;␊ + var hasRequiredOther;␊ + ␊ + function requireOther () {␊ + if (hasRequiredOther) return other;␊ + hasRequiredOther = 1;␊ + other = 'foo';␊ + return other;␊ + }␊ + ␊ + exports.getDefaultExportFromCjs = getDefaultExportFromCjs;␊ + exports.requireOther = requireOther;␊ + `, + 'other.js': `'use strict';␊ ␊ - var foo = /*@__PURE__*/getDefaultExportFromCjs(other);␊ + var other$1 = require('./other-UXsUMMAz.js');␊ ␊ - module.exports = foo;␊ + var otherExports = other$1.requireOther();␊ + var other = /*@__PURE__*/other$1.getDefaultExportFromCjs(otherExports);␊ + ␊ + module.exports = other;␊ `, } @@ -4081,13 +4878,22 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - const foo = require$$0__default.default;␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - var main = foo;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = require$$0__default.default;␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + main$1 = foo;␊ + return main$1;␊ + }␊ ␊ - module.exports = main$1;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -4098,6 +4904,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -4123,25 +4933,35 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable */␊ var one = 1;␊ ␊ var two = 2;␊ ␊ - var foo$1 = /*#__PURE__*/Object.freeze({␊ + var foo = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ one: one,␊ two: two␊ });␊ ␊ - var require$$0 = /*@__PURE__*/getAugmentedNamespace(foo$1);␊ + var require$$0 = /*@__PURE__*/getAugmentedNamespace(foo);␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = require$$0;␊ ␊ - const foo = require$$0;␊ + t.is(foo.one, 1);␊ + t.is(foo.two, 2);␊ + return main$1;␊ + }␊ ␊ - t.is(foo.one, 1);␊ - t.is(foo.two, 2);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4158,20 +4978,29 @@ Generated by [AVA](https://avajs.dev). ␊ var encode = {};␊ ␊ - (function (exports) {␊ - exports.encodeURIComponent = function () {␊ - return encodeURIComponent(this.str);␊ - };␊ + var hasRequiredEncode;␊ + ␊ + function requireEncode () {␊ + if (hasRequiredEncode) return encode;␊ + hasRequiredEncode = 1;␊ + (function (exports) {␊ + exports.encodeURIComponent = function () {␊ + return encodeURIComponent(this.str);␊ + };␊ ␊ - // to ensure module is wrapped␊ - commonjsGlobal.foo = exports; ␊ - } (encode));␊ + // to ensure module is wrapped␊ + commonjsGlobal.foo = exports; ␊ + } (encode));␊ + return encode;␊ + }␊ + ␊ + var encodeExports = requireEncode();␊ ␊ /* eslint-disable */␊ ␊ const foo = {␊ str: 'test string',␊ - encodeURIComponent: encode.encodeURIComponent␊ + encodeURIComponent: encodeExports.encodeURIComponent␊ };␊ ␊ var encoded = foo.encodeURIComponent();␊ @@ -4195,21 +5024,30 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable */␊ ␊ - function foo() {␊ - const global = {};␊ - global.modified = true;␊ - return global;␊ - }␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - const notGlobal = foo();␊ - t.truthy(notGlobal.modified);␊ - t.truthy(!commonjsGlobal.modified);␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function foo() {␊ + const global = {};␊ + global.modified = true;␊ + return global;␊ + }␊ ␊ - var main = {};␊ + const notGlobal = foo();␊ + t.truthy(notGlobal.modified);␊ + t.truthy(!commonjsGlobal.modified);␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + main$1 = {};␊ + return main$1;␊ + }␊ ␊ - module.exports = main$1;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -4246,11 +5084,15 @@ Generated by [AVA](https://avajs.dev). var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmMixed);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getDefaultExportFromNamespaceIfNotNamed (n) {␊ return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmNamed__namespace);␊ ␊ @@ -4278,22 +5120,41 @@ Generated by [AVA](https://avajs.dev). ␊ var none = {};␊ ␊ - const externalNamed = require$$0;␊ - const externalMixed = require$$1;␊ - const externalDefault = require$$2;␊ + var hasRequiredNone;␊ + ␊ + function requireNone () {␊ + if (hasRequiredNone) return none;␊ + hasRequiredNone = 1;␊ + ␊ + return none;␊ + }␊ + ␊ + var hasRequiredMain;␊ ␊ - const namedExports = named;␊ - const mixedExports = mixed$1;␊ - const defaultExport = require$$5;␊ - const noExports = none;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0;␊ + const externalMixed = require$$1;␊ + const externalDefault = require$$2;␊ + ␊ + const namedExports = named;␊ + const mixedExports = mixed$1;␊ + const defaultExport = require$$5;␊ + const noExports = requireNone();␊ + ␊ + t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ + t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ + t.deepEqual(defaultExport, 'bar', 'default export');␊ + t.deepEqual(noExports, {}, 'no exports');␊ + t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ + t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ + t.deepEqual(externalDefault, 'bar', 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ - t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ - t.deepEqual(defaultExport, 'bar', 'default export');␊ - t.deepEqual(noExports, {}, 'no exports');␊ - t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ - t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ - t.deepEqual(externalDefault, 'bar', 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4332,6 +5193,10 @@ Generated by [AVA](https://avajs.dev). var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmMixed);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -4357,7 +5222,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊ ␊ @@ -4396,30 +5261,49 @@ Generated by [AVA](https://avajs.dev). ␊ var none = {};␊ ␊ - const externalNamed = require$$0;␊ - const externalMixed = require$$1;␊ - const externalDefault = require$$2;␊ - ␊ - const namedExports = require$$3;␊ - const mixedExports = require$$4;␊ - const defaultExport = require$$5;␊ - const noExports = none;␊ - ␊ - t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ - t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ - t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊ - t.deepEqual(noExports, {}, 'no exports');␊ - t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ - t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ - ␊ - /* eslint-disable no-prototype-builtins */␊ - t.is(namedExports.hasOwnProperty('foo'), true);␊ - t.is(mixedExports.hasOwnProperty('foo'), true);␊ - t.is(defaultExport.hasOwnProperty('foo'), false);␊ - t.is(externalNamed.hasOwnProperty('foo'), true);␊ - t.is(externalMixed.hasOwnProperty('foo'), true);␊ - t.is(externalDefault.hasOwnProperty('foo'), false);␊ + var hasRequiredNone;␊ + ␊ + function requireNone () {␊ + if (hasRequiredNone) return none;␊ + hasRequiredNone = 1;␊ + ␊ + return none;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0;␊ + const externalMixed = require$$1;␊ + const externalDefault = require$$2;␊ + ␊ + const namedExports = require$$3;␊ + const mixedExports = require$$4;␊ + const defaultExport = require$$5;␊ + const noExports = requireNone();␊ + ␊ + t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ + t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ + t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊ + t.deepEqual(noExports, {}, 'no exports');␊ + t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ + t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + ␊ + /* eslint-disable no-prototype-builtins */␊ + t.is(namedExports.hasOwnProperty('foo'), true);␊ + t.is(mixedExports.hasOwnProperty('foo'), true);␊ + t.is(defaultExport.hasOwnProperty('foo'), false);␊ + t.is(externalNamed.hasOwnProperty('foo'), true);␊ + t.is(externalMixed.hasOwnProperty('foo'), true);␊ + t.is(externalDefault.hasOwnProperty('foo'), false);␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4432,6 +5316,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -4457,7 +5345,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var dep_false_default_ = 'default';␊ ␊ @@ -4519,35 +5407,45 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$10 = 'default';␊ ␊ - const falseDefault = require$$0;␊ - const falseMixed = require$$1;␊ - const falseNamed = require$$2;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const falseDefault = require$$0;␊ + const falseMixed = require$$1;␊ + const falseNamed = require$$2;␊ + ␊ + const autoDefault = require$$3;␊ + const autoMixed = dep_auto_mixed_$1;␊ + const autoNamed = dep_auto_named_;␊ ␊ - const autoDefault = require$$3;␊ - const autoMixed = dep_auto_mixed_$1;␊ - const autoNamed = dep_auto_named_;␊ + const preferredDefault = require$$6;␊ + const preferredMixed = require$$7;␊ + const preferredNamed = dep_preferred_named_;␊ ␊ - const preferredDefault = require$$6;␊ - const preferredMixed = require$$7;␊ - const preferredNamed = dep_preferred_named_;␊ + const trueDefault = require$$9;␊ + const trueMixed = require$$10;␊ ␊ - const trueDefault = require$$9;␊ - const trueMixed = require$$10;␊ + t.deepEqual(falseDefault, { default: 'default' }, 'false default');␊ + t.deepEqual(falseMixed, { default: 'default', named: 'named' }, 'false mixed');␊ + t.deepEqual(falseNamed, { named: 'named' }, 'false named');␊ ␊ - t.deepEqual(falseDefault, { default: 'default' }, 'false default');␊ - t.deepEqual(falseMixed, { default: 'default', named: 'named' }, 'false mixed');␊ - t.deepEqual(falseNamed, { named: 'named' }, 'false named');␊ + t.deepEqual(autoDefault, 'default', 'auto default');␊ + t.deepEqual(autoMixed, { default: 'default', named: 'named' }, 'auto mixed');␊ + t.deepEqual(autoNamed, { named: 'named' }, 'auto named');␊ ␊ - t.deepEqual(autoDefault, 'default', 'auto default');␊ - t.deepEqual(autoMixed, { default: 'default', named: 'named' }, 'auto mixed');␊ - t.deepEqual(autoNamed, { named: 'named' }, 'auto named');␊ + t.deepEqual(preferredDefault, 'default', 'preferred default');␊ + t.deepEqual(preferredMixed, 'default', 'preferred mixed');␊ + t.deepEqual(preferredNamed, { named: 'named' }, 'preferred named');␊ ␊ - t.deepEqual(preferredDefault, 'default', 'preferred default');␊ - t.deepEqual(preferredMixed, 'default', 'preferred mixed');␊ - t.deepEqual(preferredNamed, { named: 'named' }, 'preferred named');␊ + t.deepEqual(trueDefault, 'default', 'true default');␊ + t.deepEqual(trueMixed, 'default', 'true mixed');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(trueDefault, 'default', 'true default');␊ - t.deepEqual(trueMixed, 'default', 'true mixed');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4560,27 +5458,52 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var main$1 = {};␊ ␊ + var other = {};␊ + ␊ var require$$0 = 'other.js';␊ ␊ var require$$2 = 'both.js';␊ ␊ - const other = require$$0;␊ - const both$1 = require$$2;␊ + var hasRequiredOther;␊ + ␊ + function requireOther () {␊ + if (hasRequiredOther) return other;␊ + hasRequiredOther = 1;␊ + const other$1 = require$$0;␊ + const both = require$$2;␊ ␊ - t.deepEqual(other, 'other.js', 'other other');␊ - t.deepEqual(both$1, 'both.js', 'other both');␊ + t.deepEqual(other$1, 'other.js', 'other other');␊ + t.deepEqual(both, 'both.js', 'other both');␊ + return other;␊ + }␊ ␊ var require$$1 = 'main.js';␊ ␊ - const main = require$$1;␊ - const both = require$$2;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + requireOther();␊ ␊ - t.deepEqual(main, 'main.js', 'main main');␊ - t.deepEqual(both, 'both.js', 'main both');␊ + const main = require$$1;␊ + const both = require$$2;␊ ␊ - module.exports = main$1;␊ + t.deepEqual(main, 'main.js', 'main main');␊ + t.deepEqual(both, 'both.js', 'main both');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -4619,6 +5542,10 @@ Generated by [AVA](https://avajs.dev). var require$$1__default = /*#__PURE__*/_interopDefaultCompat(require$$1);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getDefaultExportFromNamespaceIfNotNamed (n) {␊ return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;␊ }␊ @@ -4648,19 +5575,29 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(externalEsmNamed__namespace);␊ ␊ var require$$2 = /*@__PURE__*/getAugmentedNamespace(externalEsmDefault__namespace);␊ ␊ - const externalNamed = require$$0;␊ - const externalMixed = require$$1__default.default;␊ - const externalDefault = require$$2;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0;␊ + const externalMixed = require$$1__default.default;␊ + const externalDefault = require$$2;␊ + ␊ + t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'named');␊ + t.deepEqual(externalMixed, 'bar', 'mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'named');␊ - t.deepEqual(externalMixed, 'bar', 'mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4699,7 +5636,11 @@ Generated by [AVA](https://avajs.dev). var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmMixed);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ const foo$1 = 'foo';␊ ␊ @@ -4726,22 +5667,41 @@ Generated by [AVA](https://avajs.dev). ␊ var none = {};␊ ␊ - const externalNamed = externalEsmNamed__namespace;␊ - const externalMixed = externalEsmMixed__namespace;␊ - const externalDefault = externalEsmDefault__namespace;␊ + var hasRequiredNone;␊ + ␊ + function requireNone () {␊ + if (hasRequiredNone) return none;␊ + hasRequiredNone = 1;␊ + ␊ + return none;␊ + }␊ + ␊ + var hasRequiredMain;␊ ␊ - const namedExports = named;␊ - const mixedExports = mixed$1;␊ - const defaultExport = _default$1;␊ - const noExports = none;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = externalEsmNamed__namespace;␊ + const externalMixed = externalEsmMixed__namespace;␊ + const externalDefault = externalEsmDefault__namespace;␊ + ␊ + const namedExports = named;␊ + const mixedExports = mixed$1;␊ + const defaultExport = _default$1;␊ + const noExports = requireNone();␊ + ␊ + t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ + t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ + t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊ + t.deepEqual(noExports, {}, 'no exports');␊ + t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ + t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ - t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ - t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊ - t.deepEqual(noExports, {}, 'no exports');␊ - t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ - t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4780,11 +5740,15 @@ Generated by [AVA](https://avajs.dev). var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmMixed);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getDefaultExportFromNamespaceIfPresent (n) {␊ return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$0 = /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(externalEsmNamed__namespace);␊ ␊ @@ -4805,32 +5769,51 @@ Generated by [AVA](https://avajs.dev). ␊ var none = {};␊ ␊ - const externalNamed = require$$0;␊ - const externalMixed = require$$1;␊ - const externalDefault = require$$2;␊ + var hasRequiredNone;␊ ␊ - const namedExports = named;␊ - const mixedExports = require$$4;␊ - const defaultExport = require$$5;␊ - const noExports = none;␊ + function requireNone () {␊ + if (hasRequiredNone) return none;␊ + hasRequiredNone = 1;␊ ␊ - t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ - t.deepEqual(mixedExports, 'bar', 'mixed exports');␊ - t.deepEqual(defaultExport, 'bar', 'default export');␊ - t.deepEqual(noExports, {}, 'no exports');␊ - t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ - t.deepEqual(externalMixed, 'bar', 'external mixed');␊ - t.deepEqual(externalDefault, 'bar', 'external default');␊ + return none;␊ + }␊ ␊ - module.exports = main;␊ - `, - } - -## import-esm-require-returns-default-true - -> Snapshot 1 - - { + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0;␊ + const externalMixed = require$$1;␊ + const externalDefault = require$$2;␊ + ␊ + const namedExports = named;␊ + const mixedExports = require$$4;␊ + const defaultExport = require$$5;␊ + const noExports = requireNone();␊ + ␊ + t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ + t.deepEqual(mixedExports, 'bar', 'mixed exports');␊ + t.deepEqual(defaultExport, 'bar', 'default export');␊ + t.deepEqual(noExports, {}, 'no exports');␊ + t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ + t.deepEqual(externalMixed, 'bar', 'external mixed');␊ + t.deepEqual(externalDefault, 'bar', 'external default');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ + `, + } + +## import-esm-require-returns-default-true + +> Snapshot 1 + + { 'main.js': `'use strict';␊ ␊ var require$$0 = require('external-esm-named');␊ @@ -4843,24 +5826,38 @@ Generated by [AVA](https://avajs.dev). var require$$1__default = /*#__PURE__*/_interopDefaultCompat(require$$1);␊ var require$$2__default = /*#__PURE__*/_interopDefaultCompat(require$$2);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var require$$3 = 'bar';␊ ␊ var require$$4 = 'bar';␊ ␊ - const externalNamed = require$$0__default.default;␊ - const externalMixed = require$$1__default.default;␊ - const externalDefault = require$$2__default.default;␊ + var hasRequiredMain;␊ ␊ - const mixedExports = require$$3;␊ - const defaultExport = require$$4;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0__default.default;␊ + const externalMixed = require$$1__default.default;␊ + const externalDefault = require$$2__default.default;␊ + ␊ + const mixedExports = require$$3;␊ + const defaultExport = require$$4;␊ + ␊ + t.deepEqual(mixedExports, 'bar', 'mixed exports');␊ + t.deepEqual(defaultExport, 'bar', 'default export');␊ + t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ + t.deepEqual(externalMixed, 'bar', 'external mixed');␊ + t.deepEqual(externalDefault, 'bar', 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(mixedExports, 'bar', 'mixed exports');␊ - t.deepEqual(defaultExport, 'bar', 'default export');␊ - t.deepEqual(externalNamed, { foo: 'foo' }, 'external named');␊ - t.deepEqual(externalMixed, 'bar', 'external mixed');␊ - t.deepEqual(externalDefault, 'bar', 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4899,6 +5896,10 @@ Generated by [AVA](https://avajs.dev). var externalEsmMixed__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmMixed);␊ var externalEsmDefault__namespace = /*#__PURE__*/_interopNamespaceCompat(externalEsmDefault);␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -4924,7 +5925,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(externalEsmNamed__namespace);␊ ␊ @@ -4963,22 +5964,41 @@ Generated by [AVA](https://avajs.dev). ␊ var none = {};␊ ␊ - const externalNamed = require$$0;␊ - const externalMixed = require$$1;␊ - const externalDefault = require$$2;␊ + var hasRequiredNone;␊ ␊ - const namedExports = require$$3;␊ - const mixedExports = require$$4;␊ - const defaultExport = require$$5;␊ - const noExports = none;␊ + function requireNone () {␊ + if (hasRequiredNone) return none;␊ + hasRequiredNone = 1;␊ + ␊ + return none;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const externalNamed = require$$0;␊ + const externalMixed = require$$1;␊ + const externalDefault = require$$2;␊ + ␊ + const namedExports = require$$3;␊ + const mixedExports = require$$4;␊ + const defaultExport = require$$5;␊ + const noExports = requireNone();␊ + ␊ + t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ + t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ + t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊ + t.deepEqual(noExports, {}, 'no exports');␊ + t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ + t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ + t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(namedExports, { foo: 'foo' }, 'named exports');␊ - t.deepEqual(mixedExports, { foo: 'foo', default: 'bar' }, 'mixed exports');␊ - t.deepEqual(defaultExport, { default: 'bar' }, 'default export');␊ - t.deepEqual(noExports, {}, 'no exports');␊ - t.deepEqual(externalNamed, { foo: 'foo', default: { foo: 'foo' } }, 'external named');␊ - t.deepEqual(externalMixed, { foo: 'foo', default: 'bar' }, 'external mixed');␊ - t.deepEqual(externalDefault, { default: 'bar' }, 'external default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -4991,6 +6011,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -5016,7 +6040,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ /* eslint-disable import/no-mutable-exports */␊ let foo = 'foo';␊ @@ -5027,30 +6051,40 @@ Generated by [AVA](https://avajs.dev). bar = newBar;␊ }␊ ␊ - var lib$1 = /*#__PURE__*/Object.freeze({␊ + var lib = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ get bar () { return bar; },␊ get default () { return foo; },␊ update: update␊ });␊ ␊ - var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib$1);␊ + var require$$0 = /*@__PURE__*/getAugmentedNamespace(lib);␊ ␊ /* eslint-disable */␊ ␊ - var lib = require$$0;␊ + var hasRequiredMain;␊ ␊ - function _interopDefault$1(e) {␊ - return e && e.__esModule ? e : { default: e };␊ - }␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + var lib = require$$0;␊ + ␊ + function _interopDefault(e) {␊ + return e && e.__esModule ? e : { default: e };␊ + }␊ + ␊ + var lib__default = /*#__PURE__*/_interopDefault(lib);␊ + t.is(lib__default['default'], 'foo');␊ + t.is(lib.bar, 'bar');␊ ␊ - var lib__default = /*#__PURE__*/_interopDefault$1(lib);␊ - t.is(lib__default['default'], 'foo');␊ - t.is(lib.bar, 'bar');␊ + lib.update('newFoo', 'newBar');␊ + t.is(lib__default['default'], 'newFoo');␊ + t.is(lib.bar, 'newBar');␊ + return main$1;␊ + }␊ ␊ - lib.update('newFoo', 'newBar');␊ - t.is(lib__default['default'], 'newFoo');␊ - t.is(lib.bar, 'newBar');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5063,10 +6097,6 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - function getDefaultExportFromCjs (x) {␊ - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ - }␊ - ␊ var dep = {};␊ ␊ var hasRequiredDep;␊ @@ -5103,7 +6133,7 @@ Generated by [AVA](https://avajs.dev). }␊ ␊ var mainExports = requireMain();␊ - var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + var main = mainExports.default;␊ ␊ module.exports = main;␊ `, @@ -5116,13 +6146,35 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var foo;␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo = 42;␊ + return foo;␊ + }␊ + ␊ + var hasRequiredMain;␊ ␊ - var foo$1 = 42;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ ␊ - const foo = foo$1;␊ + t.is(foo, 42);␊ + return main$1;␊ + }␊ ␊ - t.is(foo, 42);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5163,13 +6215,22 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable global-require */␊ ␊ - var main = function () {␊ - return requireMultiply()(2, requireFoo());␊ - };␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + main$1 = function () {␊ + return requireMultiply()(2, requireFoo());␊ + };␊ + return main$1;␊ + }␊ ␊ - module.exports = main$1;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -5186,18 +6247,25 @@ Generated by [AVA](https://avajs.dev). ␊ var other = {exports: {}};␊ ␊ - (function (module, exports) {␊ - exports.default = 42;␊ + var hasRequiredOther;␊ ␊ - addCompiledMarker(module.exports);␊ + function requireOther () {␊ + if (hasRequiredOther) return other.exports;␊ + hasRequiredOther = 1;␊ + (function (module, exports) {␊ + exports.default = 42;␊ ␊ - function addCompiledMarker(exports) {␊ - // eslint-disable-next-line no-param-reassign␊ - exports.__esModule = true;␊ - } ␊ - } (other, other.exports));␊ + addCompiledMarker(module.exports);␊ ␊ - var otherExports = other.exports;␊ + function addCompiledMarker(exports) {␊ + // eslint-disable-next-line no-param-reassign␊ + exports.__esModule = true;␊ + } ␊ + } (other, other.exports));␊ + return other.exports;␊ + }␊ + ␊ + var otherExports = requireOther();␊ var foo = /*@__PURE__*/getDefaultExportFromCjs(otherExports);␊ ␊ t.deepEqual(foo, 42);␊ @@ -5217,16 +6285,23 @@ Generated by [AVA](https://avajs.dev). ␊ var other = {exports: {}};␊ ␊ - (function (module) {␊ - addDefaultExport(module.exports);␊ + var hasRequiredOther;␊ ␊ - function addDefaultExport(exports) {␊ - // eslint-disable-next-line no-param-reassign␊ - exports.default = 42;␊ - } ␊ - } (other));␊ + function requireOther () {␊ + if (hasRequiredOther) return other.exports;␊ + hasRequiredOther = 1;␊ + (function (module) {␊ + addDefaultExport(module.exports);␊ ␊ - var otherExports = other.exports;␊ + function addDefaultExport(exports) {␊ + // eslint-disable-next-line no-param-reassign␊ + exports.default = 42;␊ + } ␊ + } (other));␊ + return other.exports;␊ + }␊ + ␊ + var otherExports = requireOther();␊ var foo = /*@__PURE__*/getDefaultExportFromCjs(otherExports);␊ ␊ t.deepEqual(foo, { default: 42 });␊ @@ -5240,11 +6315,25 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var other = {};␊ ␊ - other.foo = '__esModule';␊ + var hasRequiredOther;␊ + ␊ + function requireOther () {␊ + if (hasRequiredOther) return other;␊ + hasRequiredOther = 1;␊ + other.foo = '__esModule';␊ + return other;␊ + }␊ + ␊ + var otherExports = requireOther();␊ + var foo = /*@__PURE__*/getDefaultExportFromCjs(otherExports);␊ ␊ - t.deepEqual(other, { foo: '__esModule' });␊ + t.deepEqual(foo, { foo: '__esModule' });␊ `, } @@ -5257,21 +6346,32 @@ Generated by [AVA](https://avajs.dev). ␊ var other = require('./other2.js');␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ - const foo = other.other;␊ + var hasRequiredMain;␊ ␊ - t.is(foo, 'foo');␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = other.requireOther();␊ + ␊ + t.is(foo, 'foo');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/other.getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, 'other.js': `'use strict';␊ ␊ - var other = require('./other2.js');␊ - ␊ + var other$1 = require('./other2.js');␊ ␊ + var otherExports = other$1.requireOther();␊ + var other = /*@__PURE__*/other$1.getDefaultExportFromCjs(otherExports);␊ ␊ - module.exports = other.other$1;␊ + module.exports = other;␊ `, 'other2.js': `'use strict';␊ ␊ @@ -5279,12 +6379,18 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var other = 'foo';␊ + var other;␊ + var hasRequiredOther;␊ ␊ - var other$1 = /*@__PURE__*/getDefaultExportFromCjs(other);␊ + function requireOther () {␊ + if (hasRequiredOther) return other;␊ + hasRequiredOther = 1;␊ + other = 'foo';␊ + return other;␊ + }␊ ␊ - exports.other = other;␊ - exports.other$1 = other$1;␊ + exports.getDefaultExportFromCjs = getDefaultExportFromCjs;␊ + exports.requireOther = requireOther;␊ `, } @@ -5303,11 +6409,21 @@ Generated by [AVA](https://avajs.dev). * This comment could be really important and should not be removed␊ */␊ ␊ - var main = 'bar';␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ ␊ - module.exports = main$1;␊ + main$1 = 'bar';␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -5324,15 +6440,30 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ /*␊ * This comment could be really important and should not be removed␊ */␊ ␊ - const externalExports = require$$0__default.default;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + ␊ + const externalExports = require$$0__default.default;␊ ␊ - t.is(externalExports.foo, 'foo');␊ + t.is(externalExports.foo, 'foo');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5355,17 +6486,25 @@ Generated by [AVA](https://avajs.dev). * This comment could be really important and should not be removed␊ */␊ ␊ - (function (exports) {␊ + var hasRequiredMain;␊ ␊ - modifyExports(exports);␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + (function (exports) {␊ ␊ - function modifyExports(exported) {␊ - // eslint-disable-next-line no-param-reassign␊ - exported.foo = 'bar';␊ - } ␊ - } (main$1));␊ + modifyExports(exports);␊ ␊ - var main = /*@__PURE__*/getDefaultExportFromCjs(main$1);␊ + function modifyExports(exported) {␊ + // eslint-disable-next-line no-param-reassign␊ + exported.foo = 'bar';␊ + } ␊ + } (main$1));␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5378,7 +6517,22 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5391,20 +6545,65 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {};␊ + var main$1 = {};␊ + ␊ + var dep = {};␊ ␊ - dep$1.foo = 'foo';␊ + var hasRequiredDep;␊ ␊ - const dep = dep$1;␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep.foo = 'foo';␊ + return dep;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ + ␊ + t.is(dep.foo, 'foo');␊ + return main$1;␊ + }␊ ␊ - t.is(dep.foo, 'foo');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, } +## module-side-effects-import-wrapped + +> 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 bar = {};␊ + ␊ + var hasRequiredBar;␊ + ␊ + function requireBar () {␊ + if (hasRequiredBar) return bar;␊ + hasRequiredBar = 1;␊ + commonjsGlobal.bar = 'bar';␊ + return bar;␊ + }␊ + ␊ + requireBar();␊ + `, + } + ## module-side-effects-late-entry > Snapshot 1 @@ -5435,6 +6634,86 @@ Generated by [AVA](https://avajs.dev). `, } +## module-side-effects-late-entry-strict + +> Snapshot 1 + + { + 'generated-foo.js': `'use strict';␊ + ␊ + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊ + ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var foo$1 = {};␊ + ␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1;␊ + hasRequiredFoo = 1;␊ + // This side-effect will only be respected if this is an entry point␊ + commonjsGlobal.foo = 'foo';␊ + return foo$1;␊ + }␊ + ␊ + var fooExports = requireFoo();␊ + var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ + ␊ + module.exports = foo;␊ + `, + 'main.js': `'use strict';␊ + ␊ + var main = 'main';␊ + ␊ + module.exports = main;␊ + `, + } + +## module-side-effects-require-wrapped + +> 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 getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var bar = {};␊ + ␊ + var hasRequiredBar;␊ + ␊ + function requireBar () {␊ + if (hasRequiredBar) return bar;␊ + hasRequiredBar = 1;␊ + commonjsGlobal.bar = 'bar';␊ + return bar;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + requireBar();␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ + `, + } + ## module_require > Snapshot 1 @@ -5446,15 +6725,32 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var foo$1 = 21;␊ + var foo;␊ + var hasRequiredFoo;␊ ␊ - const foo = foo$1;␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo = 21;␊ + return foo;␊ + }␊ ␊ - var main = foo * 2;␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ ␊ - module.exports = main$1;␊ + main$1 = foo * 2;␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -5465,15 +6761,29 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var foo = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var foo$1 = {};␊ + ␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1;␊ + hasRequiredFoo = 1;␊ + Object.defineProperty(foo$1, '__esModule', { value: true });␊ ␊ - Object.defineProperty(foo, '__esModule', { value: true });␊ + Object.defineProperty(foo$1, '__esModule', { value: true });␊ ␊ - Object.defineProperty(foo, '__esModule', { value: true });␊ + foo$1.default = 'foo';␊ + return foo$1;␊ + }␊ ␊ - var _default = foo.default = 'foo';␊ + var fooExports = requireFoo();␊ + var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ ␊ - t.deepEqual(_default, 'foo');␊ + t.deepEqual(foo, 'foo');␊ `, } @@ -5484,11 +6794,22 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var a = 1;␊ - var b = 2;␊ + var foo = {};␊ + ␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo.a = 1;␊ + foo.b = 2;␊ + return foo;␊ + }␊ + ␊ + var fooExports = requireFoo();␊ ␊ - t.is(a, 1);␊ - t.is(b, 2);␊ + t.is(fooExports.a, 1);␊ + t.is(fooExports.b, 2);␊ `, } @@ -5501,13 +6822,20 @@ Generated by [AVA](https://avajs.dev). ␊ var x = {exports: {}};␊ ␊ - if (typeof someUnknownGlobal !== 'undefined') {␊ - x.exports = { named: 'bar' };␊ - } else {␊ - x.exports = { named: 'foo' };␊ + var hasRequiredX;␊ + ␊ + function requireX () {␊ + if (hasRequiredX) return x.exports;␊ + hasRequiredX = 1;␊ + if (typeof someUnknownGlobal !== 'undefined') {␊ + x.exports = { named: 'bar' };␊ + } else {␊ + x.exports = { named: 'foo' };␊ + }␊ + return x.exports;␊ }␊ ␊ - var xExports = x.exports;␊ + var xExports = requireX();␊ ␊ t.is(xExports.named, 'foo');␊ `, @@ -5522,13 +6850,20 @@ Generated by [AVA](https://avajs.dev). ␊ var x = {exports: {}};␊ ␊ - (function (module) {␊ - window.addExport = (key, value) => {␊ - module.exports[key] = value;␊ - }; ␊ - } (x));␊ + var hasRequiredX;␊ + ␊ + function requireX () {␊ + if (hasRequiredX) return x.exports;␊ + hasRequiredX = 1;␊ + (function (module) {␊ + window.addExport = (key, value) => {␊ + module.exports[key] = value;␊ + }; ␊ + } (x));␊ + return x.exports;␊ + }␊ ␊ - var xExports = x.exports;␊ + var xExports = requireX();␊ ␊ t.is(xExports.named, undefined);␊ ␊ @@ -5547,16 +6882,23 @@ Generated by [AVA](https://avajs.dev). ␊ var x = {exports: {}};␊ ␊ - (function (module) {␊ - Object.defineProperty(module.exports, 'named', {␊ - enumerable: true,␊ - get: function get() {␊ - return 'foo';␊ - }␊ - }); ␊ - } (x));␊ + var hasRequiredX;␊ + ␊ + function requireX () {␊ + if (hasRequiredX) return x.exports;␊ + hasRequiredX = 1;␊ + (function (module) {␊ + Object.defineProperty(module.exports, 'named', {␊ + enumerable: true,␊ + get: function get() {␊ + return 'foo';␊ + }␊ + }); ␊ + } (x));␊ + return x.exports;␊ + }␊ ␊ - var xExports = x.exports;␊ + var xExports = requireX();␊ ␊ t.is(xExports.named, 'foo');␊ `, @@ -5571,11 +6913,28 @@ Generated by [AVA](https://avajs.dev). ␊ var _export = {};␊ ␊ - _export.named = 2;␊ + var hasRequired_export;␊ ␊ - var reexport = _export;␊ + function require_export () {␊ + if (hasRequired_export) return _export;␊ + hasRequired_export = 1;␊ + _export.named = 2;␊ + return _export;␊ + }␊ + ␊ + var reexport;␊ + var hasRequiredReexport;␊ + ␊ + function requireReexport () {␊ + if (hasRequiredReexport) return reexport;␊ + hasRequiredReexport = 1;␊ + reexport = require_export();␊ + return reexport;␊ + }␊ ␊ - t.is(reexport.named, 2);␊ + var reexportExports = requireReexport();␊ + ␊ + t.is(reexportExports.named, 2);␊ `, } @@ -5586,15 +6945,33 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + var reexport = {};␊ + ␊ var _export = {};␊ ␊ - _export.named = 2;␊ + var hasRequired_export;␊ + ␊ + function require_export () {␊ + if (hasRequired_export) return _export;␊ + hasRequired_export = 1;␊ + _export.named = 2;␊ + return _export;␊ + }␊ + ␊ + var hasRequiredReexport;␊ + ␊ + function requireReexport () {␊ + if (hasRequiredReexport) return reexport;␊ + hasRequiredReexport = 1;␊ + const myModule = require_export();␊ ␊ - const myModule = _export;␊ + reexport.named = myModule.named;␊ + return reexport;␊ + }␊ ␊ - var named = myModule.named;␊ + var reexportExports = requireReexport();␊ ␊ - t.is(named, 2);␊ + t.is(reexportExports.named, 2);␊ `, } @@ -5607,9 +6984,18 @@ Generated by [AVA](https://avajs.dev). ␊ var x = {};␊ ␊ - x.named = 2;␊ + var hasRequiredX;␊ + ␊ + function requireX () {␊ + if (hasRequiredX) return x;␊ + hasRequiredX = 1;␊ + x.named = 2;␊ + return x;␊ + }␊ + ␊ + var xExports = requireX();␊ ␊ - t.is(x.nonExisting, undefined);␊ + t.is(xExports.nonExisting, undefined);␊ `, } @@ -5626,12 +7012,20 @@ Generated by [AVA](https://avajs.dev). ␊ var foo$1 = {};␊ ␊ - (function (exports) {␊ + var hasRequiredFoo;␊ ␊ - exports.default = 'foo'; ␊ - } (foo$1));␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1;␊ + hasRequiredFoo = 1;␊ + (function (exports) {␊ + ␊ + exports.default = 'foo'; ␊ + } (foo$1));␊ + return foo$1;␊ + }␊ ␊ - var foo = /*@__PURE__*/getDefaultExportFromCjs(foo$1);␊ + var fooExports = requireFoo();␊ + var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ ␊ t.deepEqual(foo, { default: 'foo' });␊ `, @@ -5650,17 +7044,25 @@ Generated by [AVA](https://avajs.dev). ␊ var foo$1 = {};␊ ␊ - (function (exports) {␊ - Object.defineProperty(exports, '__esModule', { value: true });␊ + var hasRequiredFoo;␊ ␊ - {␊ - Object.defineProperty(exports, '__esModule', { value: true });␊ - }␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1;␊ + hasRequiredFoo = 1;␊ + (function (exports) {␊ + Object.defineProperty(exports, '__esModule', { value: true });␊ + ␊ + {␊ + Object.defineProperty(exports, '__esModule', { value: true });␊ + }␊ ␊ - exports.default = 'foo'; ␊ - } (foo$1));␊ + exports.default = 'foo'; ␊ + } (foo$1));␊ + return foo$1;␊ + }␊ ␊ - var foo = /*@__PURE__*/getDefaultExportFromCjs(foo$1);␊ + var fooExports = requireFoo();␊ + var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ ␊ t.deepEqual(foo, 'foo');␊ `, @@ -5673,41 +7075,65 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var dep1 = {};␊ ␊ - dep1.foo = 'first';␊ + var hasRequiredDep1;␊ + ␊ + function requireDep1 () {␊ + if (hasRequiredDep1) return dep1;␊ + hasRequiredDep1 = 1;␊ + dep1.foo = 'first';␊ + ␊ + reassignSomeExports();␊ + reassignSomeMoreExports();␊ ␊ - reassignSomeExports$1();␊ - reassignSomeMoreExports$1();␊ + function reassignSomeExports() {␊ + dep1.foo = 'second';␊ + dep1.bar = 'first';␊ + }␊ ␊ - function reassignSomeExports$1() {␊ - dep1.foo = 'second';␊ - dep1.bar = 'first';␊ + function reassignSomeMoreExports() {␊ + dep1.bar = 'second';␊ + }␊ + return dep1;␊ }␊ ␊ - function reassignSomeMoreExports$1() {␊ - dep1.bar = 'second';␊ - }␊ + var dep1Exports = requireDep1();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(dep1Exports);␊ ␊ - var bar;␊ - var foo = 'first';␊ + var dep2 = {};␊ ␊ - reassignSomeExports();␊ - reassignSomeMoreExports();␊ + var hasRequiredDep2;␊ ␊ - function reassignSomeExports() {␊ - foo = 'second';␊ - bar = 'first';␊ - }␊ + function requireDep2 () {␊ + if (hasRequiredDep2) return dep2;␊ + hasRequiredDep2 = 1;␊ + dep2.foo = 'first';␊ + ␊ + reassignSomeExports();␊ + reassignSomeMoreExports();␊ + ␊ + function reassignSomeExports() {␊ + dep2.foo = 'second';␊ + dep2.bar = 'first';␊ + }␊ ␊ - function reassignSomeMoreExports() {␊ - bar = 'second';␊ + function reassignSomeMoreExports() {␊ + dep2.bar = 'second';␊ + }␊ + return dep2;␊ }␊ ␊ - t.is(dep1.foo, 'second');␊ - t.is(dep1.bar, 'second');␊ - t.is(foo, 'second');␊ - t.is(bar, 'second');␊ + var dep2Exports = requireDep2();␊ + ␊ + t.is(dep.foo, 'second');␊ + t.is(dep.bar, 'second');␊ + t.is(dep2Exports.foo, 'second');␊ + t.is(dep2Exports.bar, 'second');␊ `, } @@ -5718,13 +7144,35 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ - var dep$1 = 42;␊ + var dep;␊ + var hasRequiredDep;␊ ␊ - const dep = dep$1;␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep = 42;␊ + return dep;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ + ␊ + t.is(dep, 42);␊ + return main$1;␊ + }␊ ␊ - t.is(dep, 42);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5737,15 +7185,36 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {};␊ + var main$1 = {};␊ ␊ - dep$1.foo = 'bar';␊ + var dep = {};␊ ␊ - const dep = dep$1;␊ + var hasRequiredDep;␊ ␊ - t.is(dep.foo, 'bar');␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep.foo = 'bar';␊ + return dep;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = /*@__PURE__*/ requireDep();␊ + ␊ + t.is(dep.foo, 'bar');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5758,32 +7227,56 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ - ␊ - var dep1$1 = {exports: {}};␊ - ␊ - if (reassignFirstModuleExports) {␊ - dep1$1.exports = 'reassigned';␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var dep1Exports = dep1$1.exports;␊ + var main$1 = {};␊ + ␊ + var dep1 = {exports: {}};␊ ␊ - var dep2$1 = {exports: {}};␊ + var hasRequiredDep1;␊ ␊ - if (reassignSecondModuleExports) {␊ - dep2$1.exports = 'reassigned';␊ + function requireDep1 () {␊ + if (hasRequiredDep1) return dep1.exports;␊ + hasRequiredDep1 = 1;␊ + if (reassignFirstModuleExports) {␊ + dep1.exports = 'reassigned';␊ + }␊ + return dep1.exports;␊ }␊ ␊ - var dep2Exports = dep2$1.exports;␊ + var dep2 = {exports: {}};␊ ␊ - const dep1 = dep1Exports;␊ - const dep2 = dep2Exports;␊ + var hasRequiredDep2;␊ ␊ - t.is(dep1, 'reassigned');␊ - t.deepEqual(dep2, {});␊ + function requireDep2 () {␊ + if (hasRequiredDep2) return dep2.exports;␊ + hasRequiredDep2 = 1;␊ + if (reassignSecondModuleExports) {␊ + dep2.exports = 'reassigned';␊ + }␊ + return dep2.exports;␊ + }␊ ␊ - module.exports = main;␊ - `, + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep1 = requireDep1();␊ + const dep2 = requireDep2();␊ + ␊ + t.is(dep1, 'reassigned');␊ + t.deepEqual(dep2, {});␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ + `, } ## ordering @@ -5793,24 +7286,65 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var shared$2 = {␊ - fooLoaded: false␊ - };␊ + var main$1 = {};␊ + ␊ + var foo = {};␊ + ␊ + var shared;␊ + var hasRequiredShared;␊ + ␊ + function requireShared () {␊ + if (hasRequiredShared) return shared;␊ + hasRequiredShared = 1;␊ + shared = {␊ + fooLoaded: false␊ + };␊ + return shared;␊ + }␊ + ␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + const shared = requireShared();␊ ␊ - const shared$1 = shared$2;␊ + // Mutate the shared module␊ + shared.fooLoaded = true;␊ + return foo;␊ + }␊ + ␊ + var bar;␊ + var hasRequiredBar;␊ ␊ - // Mutate the shared module␊ - shared$1.fooLoaded = true;␊ + function requireBar () {␊ + if (hasRequiredBar) return bar;␊ + hasRequiredBar = 1;␊ + const shared = requireShared();␊ + ␊ + bar = shared.fooLoaded;␊ + return bar;␊ + }␊ + ␊ + var hasRequiredMain;␊ ␊ - const shared = shared$2;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + requireFoo();␊ ␊ - var bar = shared.fooLoaded;␊ + const fooLoaded = requireBar();␊ ␊ - const fooLoaded = bar;␊ + t.truthy(fooLoaded);␊ + return main$1;␊ + }␊ ␊ - t.truthy(fooLoaded);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5831,18 +7365,40 @@ Generated by [AVA](https://avajs.dev). ␊ var foo = 'imported';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ var requiring = {};␊ ␊ - var fooRequired = 'required';␊ + var fooRequired;␊ + var hasRequiredFooRequired;␊ + ␊ + function requireFooRequired () {␊ + if (hasRequiredFooRequired) return fooRequired;␊ + hasRequiredFooRequired = 1;␊ + fooRequired = 'required';␊ + return fooRequired;␊ + }␊ + ␊ + var hasRequiredRequiring;␊ ␊ - requiring.foo = fooRequired;␊ + function requireRequiring () {␊ + if (hasRequiredRequiring) return requiring;␊ + hasRequiredRequiring = 1;␊ + requiring.foo = requireFooRequired();␊ + ␊ + requiring.barPromise = Promise.resolve().then(function () { return require('./bar-imported-QFe_5Jm2.js'); });␊ + return requiring;␊ + }␊ ␊ - requiring.barPromise = Promise.resolve().then(function () { return require('./bar-imported-QFe_5Jm2.js'); });␊ + var requiringExports = requireRequiring();␊ + var required = /*@__PURE__*/getDefaultExportFromCjs(requiringExports);␊ ␊ t.is(foo, 'imported');␊ - t.is(requiring.foo, 'required');␊ + t.is(required.foo, 'required');␊ ␊ - var main = Promise.all([Promise.resolve().then(function () { return require('./bar-imported-QFe_5Jm2.js'); }), requiring.barPromise]);␊ + var main = Promise.all([Promise.resolve().then(function () { return require('./bar-imported-QFe_5Jm2.js'); }), required.barPromise]);␊ ␊ module.exports = main;␊ `, @@ -5863,15 +7419,32 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - t.is(commonjsGlobal.entryDetected, true);␊ - var dep = 'dep';␊ + var dep;␊ + var hasRequiredDep;␊ ␊ - t.is(commonjsGlobal.entryDetected, true);␊ - var main = dep;␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + t.is(commonjsGlobal.entryDetected, true);␊ + dep = 'dep';␊ + return dep;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - module.exports = main$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.is(commonjsGlobal.entryDetected, true);␊ + main$1 = requireDep();␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, 'other.js': `'use strict';␊ ␊ @@ -5888,6 +7461,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -5913,28 +7490,38 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ - function Dep$1(){}␊ + function Dep(){}␊ ␊ var dep = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ - default: Dep$1␊ + default: Dep␊ });␊ ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(dep);␊ ␊ - const Dep = require$$0;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const Dep = require$$0;␊ + ␊ + class Main extends Dep {␊ + constructor() {␊ + super();␊ + this.name = this.constructor.name;␊ + }␊ + static name = "main";␊ + }␊ ␊ - class Main extends Dep {␊ - constructor() {␊ - super();␊ - this.name = this.constructor.name;␊ - }␊ - static name = "main";␊ + t.is(new Main().name, "main");␊ + return main$1;␊ }␊ ␊ - t.is(new Main().name, "main");␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -5980,23 +7567,43 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + var commonjsFoo = {};␊ + ␊ var commonjsBar = {};␊ ␊ /* eslint-disable no-underscore-dangle */␊ ␊ - function Bar$1() {␊ - this.x = 42;␊ - }␊ + var hasRequiredCommonjsBar;␊ + ␊ + function requireCommonjsBar () {␊ + if (hasRequiredCommonjsBar) return commonjsBar;␊ + hasRequiredCommonjsBar = 1;␊ + function Bar() {␊ + this.x = 42;␊ + }␊ ␊ - commonjsBar.__esModule = true;␊ - commonjsBar.default = Bar$1;␊ + commonjsBar.__esModule = true;␊ + commonjsBar.default = Bar;␊ + return commonjsBar;␊ + }␊ ␊ /* eslint-disable no-underscore-dangle */␊ ␊ - const Bar = commonjsBar;␊ - var Bar_1 = Bar.default;␊ + var hasRequiredCommonjsFoo;␊ + ␊ + function requireCommonjsFoo () {␊ + if (hasRequiredCommonjsFoo) return commonjsFoo;␊ + hasRequiredCommonjsFoo = 1;␊ + const Bar = requireCommonjsBar();␊ + ␊ + commonjsFoo.__esModule = true;␊ + commonjsFoo.Bar = Bar.default;␊ + return commonjsFoo;␊ + }␊ + ␊ + var commonjsFooExports = requireCommonjsFoo();␊ ␊ - t.is(new Bar_1().x, 42);␊ + t.is(new commonjsFooExports.Bar().x, 42);␊ `, } @@ -6007,45 +7614,87 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var identifier$1 = {};␊ + var main$1 = {};␊ ␊ - (function (exports) {␊ - exports = 'foo';␊ - t.is(exports, 'foo'); ␊ - } (identifier$1));␊ + var identifier = {};␊ ␊ - var property$1 = {};␊ + var hasRequiredIdentifier;␊ ␊ - (function (exports) {␊ - ({ foo: exports } = { foo: 'foo' });␊ - t.is(exports, 'foo'); ␊ - } (property$1));␊ + function requireIdentifier () {␊ + if (hasRequiredIdentifier) return identifier;␊ + hasRequiredIdentifier = 1;␊ + (function (exports) {␊ + exports = 'foo';␊ + t.is(exports, 'foo'); ␊ + } (identifier));␊ + return identifier;␊ + }␊ ␊ - var arrayPattern$1 = {};␊ + var property = {};␊ ␊ - (function (exports) {␊ - [exports] = ['foo'];␊ - t.is(exports, 'foo'); ␊ - } (arrayPattern$1));␊ + var hasRequiredProperty;␊ ␊ - var assignmentPattern$1 = {};␊ + function requireProperty () {␊ + if (hasRequiredProperty) return property;␊ + hasRequiredProperty = 1;␊ + (function (exports) {␊ + ({ foo: exports } = { foo: 'foo' });␊ + t.is(exports, 'foo'); ␊ + } (property));␊ + return property;␊ + }␊ ␊ - (function (exports) {␊ - ({ exports = 'foo' } = {});␊ - t.is(exports, 'foo'); ␊ - } (assignmentPattern$1));␊ + var arrayPattern = {};␊ + ␊ + var hasRequiredArrayPattern;␊ + ␊ + function requireArrayPattern () {␊ + if (hasRequiredArrayPattern) return arrayPattern;␊ + hasRequiredArrayPattern = 1;␊ + (function (exports) {␊ + [exports] = ['foo'];␊ + t.is(exports, 'foo'); ␊ + } (arrayPattern));␊ + return arrayPattern;␊ + }␊ + ␊ + var assignmentPattern = {};␊ ␊ - const identifier = identifier$1;␊ - const property = property$1;␊ - const arrayPattern = arrayPattern$1;␊ - const assignmentPattern = assignmentPattern$1;␊ + var hasRequiredAssignmentPattern;␊ + ␊ + function requireAssignmentPattern () {␊ + if (hasRequiredAssignmentPattern) return assignmentPattern;␊ + hasRequiredAssignmentPattern = 1;␊ + (function (exports) {␊ + ({ exports = 'foo' } = {});␊ + t.is(exports, 'foo'); ␊ + } (assignmentPattern));␊ + return assignmentPattern;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const identifier = requireIdentifier();␊ + const property = requireProperty();␊ + const arrayPattern = requireArrayPattern();␊ + const assignmentPattern = requireAssignmentPattern();␊ + ␊ + t.deepEqual(identifier, {});␊ + t.deepEqual(property, {});␊ + t.deepEqual(arrayPattern, {});␊ + t.deepEqual(assignmentPattern, {});␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(identifier, {});␊ - t.deepEqual(property, {});␊ - t.deepEqual(arrayPattern, {});␊ - t.deepEqual(assignmentPattern, {});␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6058,65 +7707,99 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var identifier = {exports: {}};␊ ␊ - var identifier$1 = {exports: {}};␊ + identifier.exports;␊ ␊ - identifier$1.exports;␊ + var hasRequiredIdentifier;␊ ␊ - (function (module) {␊ - // eslint-disable-next-line no-global-assign␊ - module = 'foo';␊ - t.is(module, 'foo'); ␊ - } (identifier$1));␊ + function requireIdentifier () {␊ + if (hasRequiredIdentifier) return identifier.exports;␊ + hasRequiredIdentifier = 1;␊ + (function (module) {␊ + // eslint-disable-next-line no-global-assign␊ + module = 'foo';␊ + t.is(module, 'foo'); ␊ + } (identifier));␊ + return identifier.exports;␊ + }␊ ␊ - var identifierExports = identifier$1.exports;␊ + var property = {exports: {}};␊ ␊ - var property$1 = {exports: {}};␊ + property.exports;␊ ␊ - property$1.exports;␊ + var hasRequiredProperty;␊ ␊ - (function (module) {␊ - // eslint-disable-next-line no-global-assign␊ - ({ foo: module } = { foo: 'foo' });␊ - t.is(module, 'foo'); ␊ - } (property$1));␊ + function requireProperty () {␊ + if (hasRequiredProperty) return property.exports;␊ + hasRequiredProperty = 1;␊ + (function (module) {␊ + // eslint-disable-next-line no-global-assign␊ + ({ foo: module } = { foo: 'foo' });␊ + t.is(module, 'foo'); ␊ + } (property));␊ + return property.exports;␊ + }␊ ␊ - var propertyExports = property$1.exports;␊ + var arrayPattern = {exports: {}};␊ ␊ - var arrayPattern$1 = {exports: {}};␊ + arrayPattern.exports;␊ ␊ - arrayPattern$1.exports;␊ + var hasRequiredArrayPattern;␊ ␊ - (function (module) {␊ - // eslint-disable-next-line no-global-assign␊ - [module] = ['foo'];␊ - t.is(module, 'foo'); ␊ - } (arrayPattern$1));␊ + function requireArrayPattern () {␊ + if (hasRequiredArrayPattern) return arrayPattern.exports;␊ + hasRequiredArrayPattern = 1;␊ + (function (module) {␊ + // eslint-disable-next-line no-global-assign␊ + [module] = ['foo'];␊ + t.is(module, 'foo'); ␊ + } (arrayPattern));␊ + return arrayPattern.exports;␊ + }␊ ␊ - var arrayPatternExports = arrayPattern$1.exports;␊ + var assignmentPattern = {exports: {}};␊ ␊ - var assignmentPattern$1 = {exports: {}};␊ + assignmentPattern.exports;␊ ␊ - assignmentPattern$1.exports;␊ + var hasRequiredAssignmentPattern;␊ ␊ - (function (module) {␊ - // eslint-disable-next-line no-global-assign␊ - ({ module = 'foo' } = {});␊ - t.is(module, 'foo'); ␊ - } (assignmentPattern$1));␊ + function requireAssignmentPattern () {␊ + if (hasRequiredAssignmentPattern) return assignmentPattern.exports;␊ + hasRequiredAssignmentPattern = 1;␊ + (function (module) {␊ + // eslint-disable-next-line no-global-assign␊ + ({ module = 'foo' } = {});␊ + t.is(module, 'foo'); ␊ + } (assignmentPattern));␊ + return assignmentPattern.exports;␊ + }␊ ␊ - var assignmentPatternExports = assignmentPattern$1.exports;␊ + var hasRequiredMain;␊ ␊ - const identifier = identifierExports;␊ - const property = propertyExports;␊ - const arrayPattern = arrayPatternExports;␊ - const assignmentPattern = assignmentPatternExports;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const identifier = requireIdentifier();␊ + const property = requireProperty();␊ + const arrayPattern = requireArrayPattern();␊ + const assignmentPattern = requireAssignmentPattern();␊ + ␊ + t.deepEqual(identifier, {}, 'identifier');␊ + t.deepEqual(property, {}, 'property');␊ + t.deepEqual(arrayPattern, {}, 'arrayPattern');␊ + t.deepEqual(assignmentPattern, {}, 'assignmentPattern');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(identifier, {}, 'identifier');␊ - t.deepEqual(property, {}, 'property');␊ - t.deepEqual(arrayPattern, {}, 'arrayPattern');␊ - t.deepEqual(assignmentPattern, {}, 'assignmentPattern');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6176,21 +7859,40 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {exports: {}};␊ + var main$1 = {};␊ + ␊ + var dep = {exports: {}};␊ + ␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep.exports;␊ + hasRequiredDep = 1;␊ + const exported = {};␊ + dep.exports = exported;␊ + dep.exports.foo = 'foo';␊ ␊ - const exported = {};␊ - dep$1.exports = exported;␊ - dep$1.exports.foo = 'foo';␊ + t.deepEqual(exported, { foo: 'foo' }, 'exported in dep.js');␊ + return dep.exports;␊ + }␊ ␊ - t.deepEqual(exported, { foo: 'foo' }, 'exported in dep.js');␊ + var hasRequiredMain;␊ ␊ - var depExports = dep$1.exports;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ ␊ - const dep = depExports;␊ + t.deepEqual(dep, { foo: 'foo' }, 'imported in main.js');␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(dep, { foo: 'foo' }, 'imported in main.js');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6203,21 +7905,43 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var foo_1;␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo_1;␊ + hasRequiredFoo = 1;␊ + function foo() {}␊ + foo.something = false;␊ + ␊ + foo_1 = foo;␊ + return foo_1;␊ + }␊ ␊ - function foo$1() {}␊ - foo$1.something = false;␊ + var hasRequiredMain;␊ ␊ - var foo_1 = foo$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + let foo = requireFoo();␊ ␊ - let foo = foo_1;␊ + if (!foo.something) {␊ + foo = function somethingElse() {};␊ + foo.something = true;␊ + }␊ ␊ - if (!foo.something) {␊ - foo = function somethingElse() {};␊ - foo.something = true;␊ + t.truthy(foo.something);␊ + return main$1;␊ }␊ ␊ - t.truthy(foo.something);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6236,11 +7960,25 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - const { foo } = require$$0__default.default;␊ + var main$1 = {};␊ ␊ - t.is(foo, 'foo');␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const { foo } = require$$0__default.default;␊ + ␊ + t.is(foo, 'foo');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6253,7 +7991,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ const foo = 'foo';␊ var other = 'bar';␊ @@ -6264,17 +8006,27 @@ Generated by [AVA](https://avajs.dev). foo: foo␊ });␊ ␊ - var dep$1 = 'default';␊ + var dep = 'default';␊ ␊ - var dep$2 = /*#__PURE__*/Object.freeze({␊ + var dep$1 = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ - default: dep$1,␊ + default: dep,␊ ns: other$1␊ });␊ ␊ - const dep = dep$2;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = dep$1;␊ + ␊ + t.deepEqual(dep, { default: 'default', ns: { default: 'bar', foo: 'foo' } });␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(dep, { default: 'default', ns: { default: 'bar', foo: 'foo' } });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6287,21 +8039,35 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ const foo = 'foo';␊ ␊ - var dep$1 = 'default';␊ + var dep = 'default';␊ ␊ - var dep$2 = /*#__PURE__*/Object.freeze({␊ + var dep$1 = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ - default: dep$1,␊ + default: dep,␊ foo: foo␊ });␊ ␊ - const dep = dep$2;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = dep$1;␊ + ␊ + t.deepEqual(dep, { default: 'default', foo: 'foo' });␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(dep, { default: 'default', foo: 'foo' });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6314,7 +8080,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ const foo = 'foo';␊ var other = 'bar';␊ @@ -6325,9 +8095,19 @@ Generated by [AVA](https://avajs.dev). foo: foo␊ });␊ ␊ - const dep = other$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = other$1;␊ + ␊ + t.deepEqual(dep, { default: 'bar', foo: 'foo' });␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(dep, { default: 'bar', foo: 'foo' });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6340,18 +8120,32 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ const foo = 'foo';␊ ␊ - var dep$1 = /*#__PURE__*/Object.freeze({␊ + var dep = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ foo: foo␊ });␊ ␊ - const dep = dep$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep$1 = dep;␊ + ␊ + t.deepEqual(dep$1, { foo: 'foo' });␊ + return main$1;␊ + }␊ ␊ - t.deepEqual(dep, { foo: 'foo' });␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6364,21 +8158,43 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {␊ - foo: 'foo',␊ - update: () => (dep$1 = { foo: 'bar' })␊ - };␊ + var main$1 = {};␊ ␊ - const dep = dep$1;␊ + var dep;␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep = {␊ + foo: 'foo',␊ + update: () => (dep = { foo: 'bar' })␊ + };␊ + return dep;␊ + }␊ ␊ - t.is(dep.foo, 'foo');␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ + ␊ + t.is(dep.foo, 'foo');␊ ␊ - dep.update();␊ + dep.update();␊ + ␊ + t.is(dep.foo, 'foo');␊ + t.is(requireDep().foo, 'bar');␊ + return main$1;␊ + }␊ ␊ - t.is(dep.foo, 'foo');␊ - t.is(dep$1.foo, 'bar');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6391,6 +8207,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -6416,7 +8236,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ const result = 'second';␊ ␊ @@ -6427,7 +8247,17 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(second);␊ ␊ - t.is(require$$0.result, 'second');␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.is(require$$0.result, 'second');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6440,6 +8270,10 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ function getAugmentedNamespace(n) {␊ if (n.__esModule) return n;␊ var f = n.default;␊ @@ -6465,7 +8299,7 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var main = {};␊ + var main$1 = {};␊ ␊ const result = 'second';␊ ␊ @@ -6476,7 +8310,17 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(second);␊ ␊ - t.is(require$$0.result, 'second');␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + t.is(require$$0.result, 'second');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6489,23 +8333,45 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var foo;␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo = 'foo';␊ + return foo;␊ + }␊ ␊ - var foo$1 = 'foo';␊ + var hasRequiredMain;␊ ␊ - const foo = foo$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ ␊ - t.is(foo, 'foo');␊ + t.is(foo, 'foo');␊ ␊ - {␊ - // eslint-disable-next-line no-shadow␊ - const foo = 'wrong';␊ - // eslint-disable-next-line global-require␊ - const bar = foo$1;␊ - t.is(foo, 'wrong');␊ - t.is(bar, 'foo');␊ + {␊ + // eslint-disable-next-line no-shadow␊ + const foo = 'wrong';␊ + // eslint-disable-next-line global-require␊ + const bar = requireFoo();␊ + t.is(foo, 'wrong');␊ + t.is(bar, 'foo');␊ + }␊ + return main$1;␊ }␊ ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ module.exports = main;␊ `, } @@ -6517,17 +8383,35 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - function foo(require) {␊ - require('not-an-actual-require-statement');␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - let result;␊ + var main$1 = {};␊ + ␊ + var hasRequiredMain;␊ ␊ - foo((msg) => {␊ - result = msg;␊ - });␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function foo(require) {␊ + require('not-an-actual-require-statement');␊ + }␊ + ␊ + let result;␊ ␊ - t.is(result, 'not-an-actual-require-statement');␊ + foo((msg) => {␊ + result = msg;␊ + });␊ + ␊ + t.is(result, 'not-an-actual-require-statement');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -6546,17 +8430,26 @@ Generated by [AVA](https://avajs.dev). throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');␊ }␊ ␊ - const HOST = {␊ - require: commonjsRequire␊ - };␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - var main = {␊ - HOST␊ - };␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const HOST = {␊ + require: commonjsRequire␊ + };␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + main$1 = {␊ + HOST␊ + };␊ + return main$1;␊ + }␊ ␊ - module.exports = main$1;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -6567,31 +8460,46 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - Object.defineProperty(exports, '__esModule', { value: true });␊ - ␊ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - commonjsGlobal.b = 2;␊ - var b = 'b';␊ + var main$1 = {};␊ + ␊ + var b;␊ + var hasRequiredB;␊ + ␊ + function requireB () {␊ + if (hasRequiredB) return b;␊ + hasRequiredB = 1;␊ + commonjsGlobal.b = 2;␊ + b = 'b';␊ + return b;␊ + }␊ ␊ /* eslint-disable */␊ ␊ - var conditionalTrue = main.conditionalTrue = b ;␊ - var conditionalFalse = main.conditionalFalse = b;␊ - var logicalAnd1 = main.logicalAnd1 = b;␊ - var logicalAnd2 = main.logicalAnd2 = false ;␊ - var logicalOr1 = main.logicalOr1 = true ;␊ - var logicalOr2 = main.logicalOr2 = b;␊ + var hasRequiredMain;␊ ␊ - exports.conditionalFalse = conditionalFalse;␊ - exports.conditionalTrue = conditionalTrue;␊ - exports.default = main;␊ - exports.logicalAnd1 = logicalAnd1;␊ - exports.logicalAnd2 = logicalAnd2;␊ - exports.logicalOr1 = logicalOr1;␊ - exports.logicalOr2 = logicalOr2;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + ␊ + main$1.conditionalTrue = requireB() ;␊ + main$1.conditionalFalse = requireB();␊ + main$1.logicalAnd1 = requireB();␊ + main$1.logicalAnd2 = false ;␊ + main$1.logicalOr1 = true ;␊ + main$1.logicalOr2 = requireB();␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -6692,7 +8600,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var aImportsB = {};␊ ␊ @@ -6728,7 +8640,17 @@ Generated by [AVA](https://avajs.dev). return aImportsB;␊ }␊ ␊ - requireAImportsB();␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + requireAImportsB();␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -6811,7 +8733,11 @@ Generated by [AVA](https://avajs.dev). ␊ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var throws = {};␊ ␊ @@ -6823,51 +8749,69 @@ Generated by [AVA](https://avajs.dev). throw new Error('This should never be executed or imported');␊ }␊ ␊ - var hoisted = 'this should be top-level';␊ + var hoisted;␊ + var hasRequiredHoisted;␊ + ␊ + function requireHoisted () {␊ + if (hasRequiredHoisted) return hoisted;␊ + hasRequiredHoisted = 1;␊ + hoisted = 'this should be top-level';␊ + return hoisted;␊ + }␊ ␊ /* eslint-disable global-require */␊ ␊ - commonjsGlobal.false = false;␊ - commonjsGlobal.true = true;␊ + var hasRequiredMain;␊ ␊ - if (commonjsGlobal.false) {␊ - requireThrows();␊ - }␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + commonjsGlobal.false = false;␊ + commonjsGlobal.true = true;␊ ␊ - if (commonjsGlobal.true) ; else {␊ - requireThrows();␊ - }␊ + if (commonjsGlobal.false) {␊ + requireThrows();␊ + }␊ ␊ - commonjsGlobal.false ? requireThrows() : null;␊ - commonjsGlobal.true ? null : requireThrows();␊ + if (commonjsGlobal.true) ; else {␊ + requireThrows();␊ + }␊ ␊ - commonjsGlobal.false && requireThrows();␊ - commonjsGlobal.true || requireThrows();␊ + commonjsGlobal.false ? requireThrows() : null;␊ + commonjsGlobal.true ? null : requireThrows();␊ ␊ - function requireFunctionDeclaration() {␊ - requireThrows();␊ - }␊ + commonjsGlobal.false && requireThrows();␊ + commonjsGlobal.true || requireThrows();␊ ␊ - const requireFunctionExpression = function () {␊ - requireThrows();␊ - };␊ + function requireFunctionDeclaration() {␊ + requireThrows();␊ + }␊ + ␊ + const requireFunctionExpression = function () {␊ + requireThrows();␊ + };␊ + ␊ + const requireArrowFunction = () => requireThrows();␊ ␊ - const requireArrowFunction = () => requireThrows();␊ + if (commonjsGlobal.false) {␊ + requireFunctionDeclaration();␊ + requireFunctionExpression();␊ + requireArrowFunction();␊ + }␊ ␊ - if (commonjsGlobal.false) {␊ - requireFunctionDeclaration();␊ - requireFunctionExpression();␊ - requireArrowFunction();␊ + // These should not cause wrapping␊ + t.is(␊ + (function () {␊ + return requireHoisted();␊ + })(),␊ + 'this should be top-level'␊ + );␊ + t.is((() => requireHoisted())(), 'this should be top-level');␊ + return main$1;␊ }␊ ␊ - // These should not cause wrapping␊ - t.is(␊ - (function () {␊ - return hoisted;␊ - })(),␊ - 'this should be top-level'␊ - );␊ - t.is((() => hoisted)(), 'this should be top-level');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -7286,41 +9230,62 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var foo = {};␊ ␊ - foo.augmentThis = function augmentThis() {␊ - this.x = 'x';␊ - };␊ + var hasRequiredFoo;␊ ␊ - foo.y = 'y';␊ - ␊ - foo.classThis = class classThis {␊ - constructor(){␊ - class _classThis {␊ - y = 'yyy'␊ - yyy = this.y␊ - }␊ - this._instance = new _classThis();␊ - }␊ - y = 'yy'␊ - yy = this.y␊ - };␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo.augmentThis = function augmentThis() {␊ + this.x = 'x';␊ + };␊ + ␊ + foo.y = 'y';␊ + ␊ + foo.classThis = class classThis {␊ + constructor(){␊ + class _classThis {␊ + y = 'yyy'␊ + yyy = this.y␊ + }␊ + this._instance = new _classThis();␊ + }␊ + y = 'yy'␊ + yy = this.y␊ + };␊ + return foo;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const { augmentThis, classThis, y } = requireFoo();␊ ␊ - const { augmentThis, classThis, y } = foo;␊ + const obj = {};␊ + augmentThis.call(obj);␊ ␊ - const obj = {};␊ - augmentThis.call(obj);␊ + t.is(obj.x, 'x');␊ + t.is(main$1.y, undefined);␊ + t.is(y, 'y');␊ ␊ - t.is(obj.x, 'x');␊ - t.is(main.y, undefined);␊ - t.is(y, 'y');␊ + const instance = new classThis();␊ ␊ - const instance = new classThis();␊ + t.is(instance.yy,'yy');␊ + t.is(instance._instance.yyy,'yyy');␊ + return main$1;␊ + }␊ ␊ - t.is(instance.yy,'yy');␊ - t.is(instance._instance.yyy,'yyy');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -7333,37 +9298,83 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ - ␊ - var dep1$1 = 'original';␊ - if (reassignFirstModuleExports) {␊ - dep1$1 = 'reassigned';␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var dep2$1 = 'original';␊ - if (reassignSecondModuleExports) {␊ - dep2$1 = 'reassigned';␊ - }␊ + var main$1 = {};␊ ␊ - if (reassignFirstModuleExports) {␊ - dep3$1 = 'reassigned';␊ - }␊ - var dep3$1 = 'final';␊ + var dep1;␊ + var hasRequiredDep1;␊ + ␊ + function requireDep1 () {␊ + if (hasRequiredDep1) return dep1;␊ + hasRequiredDep1 = 1;␊ + dep1 = 'original';␊ + if (reassignFirstModuleExports) {␊ + dep1 = 'reassigned';␊ + }␊ + return dep1;␊ + }␊ + ␊ + var dep2;␊ + var hasRequiredDep2;␊ + ␊ + function requireDep2 () {␊ + if (hasRequiredDep2) return dep2;␊ + hasRequiredDep2 = 1;␊ + dep2 = 'original';␊ + if (reassignSecondModuleExports) {␊ + dep2 = 'reassigned';␊ + }␊ + return dep2;␊ + }␊ + ␊ + var dep3;␊ + var hasRequiredDep3;␊ + ␊ + function requireDep3 () {␊ + if (hasRequiredDep3) return dep3;␊ + hasRequiredDep3 = 1;␊ + if (reassignFirstModuleExports) {␊ + dep3 = 'reassigned';␊ + }␊ + dep3 = 'final';␊ + return dep3;␊ + }␊ ␊ - if (reassignSecondModuleExports) {␊ - dep4$1 = 'reassigned';␊ + var dep4;␊ + var hasRequiredDep4;␊ + ␊ + function requireDep4 () {␊ + if (hasRequiredDep4) return dep4;␊ + hasRequiredDep4 = 1;␊ + if (reassignSecondModuleExports) {␊ + dep4 = 'reassigned';␊ + }␊ + dep4 = 'final';␊ + return dep4;␊ }␊ - var dep4$1 = 'final';␊ ␊ - const dep1 = dep1$1;␊ - const dep2 = dep2$1;␊ - const dep3 = dep3$1;␊ - const dep4 = dep4$1;␊ + var hasRequiredMain;␊ ␊ - t.is(dep1, 'reassigned');␊ - t.is(dep2, 'original');␊ - t.is(dep3, 'final');␊ - t.is(dep4, 'final');␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep1 = requireDep1();␊ + const dep2 = requireDep2();␊ + const dep3 = requireDep3();␊ + const dep4 = requireDep4();␊ + ␊ + t.is(dep1, 'reassigned');␊ + t.is(dep2, 'original');␊ + t.is(dep3, 'final');␊ + t.is(dep4, 'final');␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -7382,11 +9393,21 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable */␊ ␊ - var main = 'foo';␊ + var main$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + main$1 = 'foo';␊ + return main$1;␊ + }␊ ␊ - module.exports = main$1;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -7401,25 +9422,53 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var foo$1 = {exports: {}};␊ + var foo = {exports: {}};␊ ␊ - (function (module) {␊ + var bar;␊ + var hasRequiredBar;␊ ␊ - module.exports = 'bar';␊ - {␊ - return;␊ - }␊ - } (foo$1));␊ + function requireBar () {␊ + if (hasRequiredBar) return bar;␊ + hasRequiredBar = 1;␊ + bar = function () {␊ + return true;␊ + };␊ + return bar;␊ + }␊ ␊ - var fooExports = foo$1.exports;␊ + var hasRequiredFoo;␊ ␊ - const foo = fooExports;␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo.exports;␊ + hasRequiredFoo = 1;␊ + (function (module) {␊ + const bar = requireBar();␊ ␊ - var main = foo;␊ + module.exports = 'bar';␊ + if (bar()) {␊ + return;␊ + }␊ + module.exports = 'foo'; ␊ + } (foo));␊ + return foo.exports;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - module.exports = main$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ + ␊ + main$1 = foo;␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ `, } @@ -7430,13 +9479,35 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ - var foo$1 = 42;␊ + var foo;␊ + var hasRequiredFoo;␊ ␊ - const foo = foo$1;␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo = 42;␊ + return foo;␊ + }␊ ␊ - t.is(foo, 42);␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ + ␊ + t.is(foo, 42);␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -7474,9 +9545,17 @@ Generated by [AVA](https://avajs.dev). return a;␊ }␊ ␊ - var other$1 = 'other';␊ + var other$1;␊ + var hasRequiredOther;␊ + ␊ + function requireOther () {␊ + if (hasRequiredOther) return other$1;␊ + hasRequiredOther = 1;␊ + other$1 = 'other';␊ + return other$1;␊ + }␊ ␊ - const other = other$1;␊ + const other = requireOther();␊ ␊ var dep$1 = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ @@ -7528,14 +9607,19 @@ Generated by [AVA](https://avajs.dev). ␊ var other$1 = other$2.exports;␊ ␊ - Object.defineProperty(other$1, '__esModule', {␊ - value: true␊ - });␊ - other$2.exports = 'other';␊ + var hasRequiredOther;␊ ␊ - var otherExports = other$2.exports;␊ + function requireOther () {␊ + if (hasRequiredOther) return other$2.exports;␊ + hasRequiredOther = 1;␊ + Object.defineProperty(other$1, '__esModule', {␊ + value: true␊ + });␊ + other$2.exports = 'other';␊ + return other$2.exports;␊ + }␊ ␊ - const other = otherExports;␊ + const other = requireOther();␊ ␊ var dep$1 = /*#__PURE__*/Object.freeze({␊ __proto__: null,␊ @@ -7564,12 +9648,26 @@ Generated by [AVA](https://avajs.dev). ␊ var external__default = /*#__PURE__*/_interopDefaultCompat(external);␊ ␊ - var dep = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var dep$1 = {};␊ + ␊ + var hasRequiredDep;␊ ␊ - Object.defineProperty(dep, '__esModule', { value: true });␊ - var _default = dep.default = 'default';␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$1, '__esModule', { value: true });␊ + dep$1.default = 'default';␊ + return dep$1;␊ + }␊ ␊ - t.is(_default, 'default');␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ + ␊ + t.is(dep, 'default');␊ t.is(external__default.default, 'bar');␊ `, } @@ -7579,7 +9677,39 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 { - 'entry-ig6UcNgX.js': `'use strict';␊ + 'entry-ix7rhf3Z.js': `'use strict';␊ + ␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var entry = {};␊ + ␊ + var hasRequiredEntry;␊ + ␊ + function requireEntry () {␊ + if (hasRequiredEntry) return entry;␊ + hasRequiredEntry = 1;␊ + Object.defineProperty(entry, '__esModule', { value: true });␊ + entry.default = 'default';␊ + return entry;␊ + }␊ + ␊ + exports.getDefaultExportFromCjs = getDefaultExportFromCjs;␊ + exports.requireEntry = requireEntry;␊ + `, + 'entry.js': `'use strict';␊ + ␊ + var entry$1 = require('./entry-ix7rhf3Z.js');␊ + ␊ + var entryExports = entry$1.requireEntry();␊ + var entry = /*@__PURE__*/entry$1.getDefaultExportFromCjs(entryExports);␊ + ␊ + module.exports = entry;␊ + `, + 'main.js': `'use strict';␊ + ␊ + var entry$2 = require('./entry-ix7rhf3Z.js');␊ ␊ function _mergeNamespaces(n, m) {␊ m.forEach(function (e) {␊ @@ -7596,41 +9726,57 @@ Generated by [AVA](https://avajs.dev). return Object.freeze(n);␊ }␊ ␊ - var entry$1 = {};␊ - ␊ - Object.defineProperty(entry$1, '__esModule', { value: true });␊ - var _default = entry$1.default = 'default';␊ + var entryExports = entry$2.requireEntry();␊ + var entry = /*@__PURE__*/entry$2.getDefaultExportFromCjs(entryExports);␊ ␊ - var entry = /*#__PURE__*/_mergeNamespaces({␊ + var entry$1 = /*#__PURE__*/_mergeNamespaces({␊ __proto__: null,␊ - default: _default␊ - }, [entry$1]);␊ + default: entry␊ + }, [entryExports]);␊ ␊ - exports._default = _default;␊ - exports.entry = entry;␊ + t.deepEqual(entry$1, { default: 'default' });␊ `, - 'entry.js': `'use strict';␊ + } + +## transpiled-esm-entry-mixed + +> Snapshot 1 + + { + 'entry-Fl2t-jMB.js': `'use strict';␊ ␊ - var entry = require('./entry-ig6UcNgX.js');␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ + var entry = {};␊ ␊ + var hasRequiredEntry;␊ ␊ - module.exports = entry._default;␊ + function requireEntry () {␊ + if (hasRequiredEntry) return entry;␊ + hasRequiredEntry = 1;␊ + Object.defineProperty(entry, '__esModule', { value: true });␊ + entry.default = 'default';␊ + entry.named = 'named';␊ + return entry;␊ + }␊ + ␊ + exports.getDefaultExportFromCjs = getDefaultExportFromCjs;␊ + exports.requireEntry = requireEntry;␊ `, - 'main.js': `'use strict';␊ + 'entry.js': `'use strict';␊ ␊ - var entry = require('./entry-ig6UcNgX.js');␊ + var entry$1 = require('./entry-Fl2t-jMB.js');␊ ␊ - t.deepEqual(entry.entry, { default: 'default' });␊ + var entryExports = entry$1.requireEntry();␊ + var entry = /*@__PURE__*/entry$1.getDefaultExportFromCjs(entryExports);␊ + ␊ + module.exports = entry;␊ `, - } - -## transpiled-esm-entry-mixed - -> Snapshot 1 - - { - 'entry-AiU39g3m.js': `'use strict';␊ + 'main.js': `'use strict';␊ + ␊ + var entry$2 = require('./entry-Fl2t-jMB.js');␊ ␊ function _mergeNamespaces(n, m) {␊ m.forEach(function (e) {␊ @@ -7647,38 +9793,15 @@ Generated by [AVA](https://avajs.dev). return Object.freeze(n);␊ }␊ ␊ - var entry$1 = {};␊ + var entryExports = entry$2.requireEntry();␊ + var entry = /*@__PURE__*/entry$2.getDefaultExportFromCjs(entryExports);␊ ␊ - Object.defineProperty(entry$1, '__esModule', { value: true });␊ - var _default = entry$1.default = 'default';␊ - var named = entry$1.named = 'named';␊ - ␊ - var entry = /*#__PURE__*/_mergeNamespaces({␊ + var entry$1 = /*#__PURE__*/_mergeNamespaces({␊ __proto__: null,␊ - default: _default,␊ - named: named␊ - }, [entry$1]);␊ + default: entry␊ + }, [entryExports]);␊ ␊ - exports._default = _default;␊ - exports.entry = entry;␊ - exports.named = named;␊ - `, - 'entry.js': `'use strict';␊ - ␊ - Object.defineProperty(exports, '__esModule', { value: true });␊ - ␊ - var entry = require('./entry-AiU39g3m.js');␊ - ␊ - ␊ - ␊ - exports.default = entry._default;␊ - exports.named = entry.named;␊ - `, - 'main.js': `'use strict';␊ - ␊ - var entry = require('./entry-AiU39g3m.js');␊ - ␊ - t.deepEqual(entry.entry, { default: 'default', named: 'named' });␊ + t.deepEqual(entry$1, { default: 'default', named: 'named' });␊ `, } @@ -7689,52 +9812,62 @@ Generated by [AVA](https://avajs.dev). { 'entry.js': `'use strict';␊ ␊ - Object.defineProperty(exports, '__esModule', { value: true });␊ - ␊ - var entry = require('./generated-entry.js');␊ - ␊ + var entry$1 = require('./generated-entry.js');␊ ␊ + var entryExports = entry$1.requireEntry();␊ + var entry = /*@__PURE__*/entry$1.getDefaultExportFromCjs(entryExports);␊ ␊ - exports.default = entry.entry$1;␊ - exports.named = entry.named;␊ + module.exports = entry;␊ `, 'generated-entry.js': `'use strict';␊ ␊ - function _mergeNamespaces(n, m) {␊ - m.forEach(function (e) {␊ - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ - if (k !== 'default' && !(k in n)) {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - });␊ - return Object.freeze(n);␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var entry$1 = {};␊ + var entry = {};␊ ␊ - Object.defineProperty(entry$1, '__esModule', { value: true });␊ - var named = entry$1.named = 'named';␊ + var hasRequiredEntry;␊ ␊ - var entry = /*#__PURE__*/_mergeNamespaces({␊ - __proto__: null,␊ - default: entry$1,␊ - named: named␊ - }, [entry$1]);␊ + function requireEntry () {␊ + if (hasRequiredEntry) return entry;␊ + hasRequiredEntry = 1;␊ + Object.defineProperty(entry, '__esModule', { value: true });␊ + entry.named = 'named';␊ + return entry;␊ + }␊ ␊ - exports.entry = entry;␊ - exports.entry$1 = entry$1;␊ - exports.named = named;␊ + exports.getDefaultExportFromCjs = getDefaultExportFromCjs;␊ + exports.requireEntry = requireEntry;␊ `, 'main.js': `'use strict';␊ ␊ - var entry = require('./generated-entry.js');␊ + var entry$2 = require('./generated-entry.js');␊ ␊ - t.deepEqual(entry.entry, {␊ + function _mergeNamespaces(n, m) {␊ + m.forEach(function (e) {␊ + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ + if (k !== 'default' && !(k in n)) {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + });␊ + return Object.freeze(n);␊ + }␊ + ␊ + var entryExports = entry$2.requireEntry();␊ + var entry = /*@__PURE__*/entry$2.getDefaultExportFromCjs(entryExports);␊ + ␊ + var entry$1 = /*#__PURE__*/_mergeNamespaces({␊ + __proto__: null,␊ + default: entry␊ + }, [entryExports]);␊ + ␊ + t.deepEqual(entry$1, {␊ default: {␊ named: 'named'␊ },␊ @@ -7756,14 +9889,28 @@ Generated by [AVA](https://avajs.dev). ␊ var external__default = /*#__PURE__*/_interopDefaultCompat(external);␊ ␊ - var dep = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var dep$1 = {};␊ ␊ - Object.defineProperty(dep, '__esModule', { value: true });␊ - var named = dep.named = 'named';␊ - var _default = dep.default = 'default';␊ + var hasRequiredDep;␊ ␊ - t.is(_default, 'default');␊ - t.is(named, 'named');␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$1, '__esModule', { value: true });␊ + dep$1.named = 'named';␊ + dep$1.default = 'default';␊ + return dep$1;␊ + }␊ + ␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ + ␊ + t.is(dep, 'default');␊ + t.is(depExports.named, 'named');␊ t.is(external__default.default, 'bar');␊ t.is(external.foo, 'foo');␊ `, @@ -7780,10 +9927,19 @@ Generated by [AVA](https://avajs.dev). ␊ var dep = {};␊ ␊ - Object.defineProperty(dep, '__esModule', { value: true });␊ - var named = dep.named = 'named';␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep, '__esModule', { value: true });␊ + dep.named = 'named';␊ + return dep;␊ + }␊ + ␊ + var depExports = requireDep();␊ ␊ - t.is(named, 'named');␊ + t.is(depExports.named, 'named');␊ t.is(externalEsmNamed.foo, 'foo');␊ `, } @@ -7798,51 +9954,65 @@ Generated by [AVA](https://avajs.dev). var external = require('external-esm-default');␊ ␊ function _interopNamespaceCompat(e) {␊ - if (e && typeof e === 'object' && 'default' in e) return e;␊ - var n = Object.create(null);␊ - if (e) {␊ - Object.keys(e).forEach(function (k) {␊ - if (k !== 'default') {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - }␊ - n.default = e;␊ - return Object.freeze(n);␊ + if (e && typeof e === 'object' && 'default' in e) return e;␊ + var n = Object.create(null);␊ + if (e) {␊ + Object.keys(e).forEach(function (k) {␊ + if (k !== 'default') {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + }␊ + n.default = e;␊ + return Object.freeze(n);␊ }␊ ␊ function _mergeNamespaces(n, m) {␊ - m.forEach(function (e) {␊ - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ - if (k !== 'default' && !(k in n)) {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - });␊ - return Object.freeze(n);␊ + m.forEach(function (e) {␊ + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ + if (k !== 'default' && !(k in n)) {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + });␊ + return Object.freeze(n);␊ }␊ ␊ var external__namespace = /*#__PURE__*/_interopNamespaceCompat(external);␊ ␊ - var dep$1 = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - var _default = dep$1.default = 'default';␊ + var dep$2 = {};␊ ␊ - var dep = /*#__PURE__*/_mergeNamespaces({␊ - __proto__: null,␊ - default: _default␊ - }, [dep$1]);␊ + var hasRequiredDep;␊ ␊ - t.deepEqual(dep, {␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$2;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$2, '__esModule', { value: true });␊ + dep$2.default = 'default';␊ + return dep$2;␊ + }␊ + ␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ + ␊ + var dep$1 = /*#__PURE__*/_mergeNamespaces({␊ + __proto__: null,␊ + default: dep␊ + }, [depExports]);␊ + ␊ + t.deepEqual(dep$1, {␊ default: 'default'␊ });␊ ␊ @@ -7862,53 +10032,66 @@ Generated by [AVA](https://avajs.dev). var external = require('external-esm-mixed');␊ ␊ function _interopNamespaceCompat(e) {␊ - if (e && typeof e === 'object' && 'default' in e) return e;␊ - var n = Object.create(null);␊ - if (e) {␊ - Object.keys(e).forEach(function (k) {␊ - if (k !== 'default') {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - }␊ - n.default = e;␊ - return Object.freeze(n);␊ + if (e && typeof e === 'object' && 'default' in e) return e;␊ + var n = Object.create(null);␊ + if (e) {␊ + Object.keys(e).forEach(function (k) {␊ + if (k !== 'default') {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + }␊ + n.default = e;␊ + return Object.freeze(n);␊ }␊ ␊ function _mergeNamespaces(n, m) {␊ - m.forEach(function (e) {␊ - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ - if (k !== 'default' && !(k in n)) {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - });␊ - return Object.freeze(n);␊ + m.forEach(function (e) {␊ + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ + if (k !== 'default' && !(k in n)) {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + });␊ + return Object.freeze(n);␊ }␊ ␊ var external__namespace = /*#__PURE__*/_interopNamespaceCompat(external);␊ ␊ - var dep$1 = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - var named = dep$1.named = 'named';␊ - var _default = dep$1.default = 'default';␊ + var dep$2 = {};␊ ␊ - var dep = /*#__PURE__*/_mergeNamespaces({␊ - __proto__: null,␊ - default: _default,␊ - named: named␊ - }, [dep$1]);␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$2;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$2, '__esModule', { value: true });␊ + dep$2.named = 'named';␊ + dep$2.default = 'default';␊ + return dep$2;␊ + }␊ + ␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ ␊ - t.deepEqual(dep, {␊ + var dep$1 = /*#__PURE__*/_mergeNamespaces({␊ + __proto__: null,␊ + default: dep␊ + }, [depExports]);␊ + ␊ + t.deepEqual(dep$1, {␊ default: 'default',␊ named: 'named'␊ });␊ @@ -7930,52 +10113,65 @@ Generated by [AVA](https://avajs.dev). var external = require('external-esm-named');␊ ␊ function _interopNamespaceCompat(e) {␊ - if (e && typeof e === 'object' && 'default' in e) return e;␊ - var n = Object.create(null);␊ - if (e) {␊ - Object.keys(e).forEach(function (k) {␊ - if (k !== 'default') {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - }␊ - n.default = e;␊ - return Object.freeze(n);␊ + if (e && typeof e === 'object' && 'default' in e) return e;␊ + var n = Object.create(null);␊ + if (e) {␊ + Object.keys(e).forEach(function (k) {␊ + if (k !== 'default') {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + }␊ + n.default = e;␊ + return Object.freeze(n);␊ }␊ ␊ function _mergeNamespaces(n, m) {␊ - m.forEach(function (e) {␊ - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ - if (k !== 'default' && !(k in n)) {␊ - var d = Object.getOwnPropertyDescriptor(e, k);␊ - Object.defineProperty(n, k, d.get ? d : {␊ - enumerable: true,␊ - get: function () { return e[k]; }␊ - });␊ - }␊ - });␊ - });␊ - return Object.freeze(n);␊ + m.forEach(function (e) {␊ + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {␊ + if (k !== 'default' && !(k in n)) {␊ + var d = Object.getOwnPropertyDescriptor(e, k);␊ + Object.defineProperty(n, k, d.get ? d : {␊ + enumerable: true,␊ + get: function () { return e[k]; }␊ + });␊ + }␊ + });␊ + });␊ + return Object.freeze(n);␊ }␊ ␊ var external__namespace = /*#__PURE__*/_interopNamespaceCompat(external);␊ ␊ - var dep$1 = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - var named = dep$1.named = 'named';␊ + var dep$2 = {};␊ ␊ - var dep = /*#__PURE__*/_mergeNamespaces({␊ - __proto__: null,␊ - default: dep$1,␊ - named: named␊ - }, [dep$1]);␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$2;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$2, '__esModule', { value: true });␊ + dep$2.named = 'named';␊ + return dep$2;␊ + }␊ ␊ - t.deepEqual(dep, {␊ + var depExports = requireDep();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ + ␊ + var dep$1 = /*#__PURE__*/_mergeNamespaces({␊ + __proto__: null,␊ + default: dep␊ + }, [depExports]);␊ + ␊ + t.deepEqual(dep$1, {␊ default: {␊ named: 'named'␊ },␊ @@ -8002,15 +10198,22 @@ Generated by [AVA](https://avajs.dev). ␊ var dep$1 = {exports: {}};␊ ␊ - Object.defineProperty(dep$1.exports, '__esModule', { value: true });␊ + var hasRequiredDep;␊ ␊ - if (globalValue) {␊ - dep$1.exports = 'first';␊ - } else {␊ - dep$1.exports = 'second';␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1.exports;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$1.exports, '__esModule', { value: true });␊ + ␊ + if (globalValue) {␊ + dep$1.exports = 'first';␊ + } else {␊ + dep$1.exports = 'second';␊ + }␊ + return dep$1.exports;␊ }␊ ␊ - var depExports = dep$1.exports;␊ + var depExports = requireDep();␊ var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ ␊ t.is(dep, 'first');␊ @@ -8030,15 +10233,22 @@ Generated by [AVA](https://avajs.dev). ␊ var dep$1 = {exports: {}};␊ ␊ - if (globalValue) {␊ - dep$1.exports = { default: 'first' };␊ - } else {␊ - dep$1.exports = { default: 'second' };␊ - }␊ + var hasRequiredDep;␊ ␊ - Object.defineProperty(dep$1.exports, '__esModule', { value: true });␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1.exports;␊ + hasRequiredDep = 1;␊ + if (globalValue) {␊ + dep$1.exports = { default: 'first' };␊ + } else {␊ + dep$1.exports = { default: 'second' };␊ + }␊ ␊ - var depExports = dep$1.exports;␊ + Object.defineProperty(dep$1.exports, '__esModule', { value: true });␊ + return dep$1.exports;␊ + }␊ + ␊ + var depExports = requireDep();␊ var dep = /*@__PURE__*/getDefaultExportFromCjs(depExports);␊ ␊ t.is(dep, 'first');␊ @@ -8056,14 +10266,30 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var dep$1 = {};␊ - ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - dep$1.default = 'default';␊ - ␊ - var proxy = dep$1;␊ - ␊ - var dep = /*@__PURE__*/getDefaultExportFromCjs(proxy);␊ + var dep$1 = {};␊ + ␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$1, '__esModule', { value: true });␊ + dep$1.default = 'default';␊ + return dep$1;␊ + }␊ + ␊ + var proxy;␊ + var hasRequiredProxy;␊ + ␊ + function requireProxy () {␊ + if (hasRequiredProxy) return proxy;␊ + hasRequiredProxy = 1;␊ + proxy = requireDep();␊ + return proxy;␊ + }␊ + ␊ + var proxyExports = requireProxy();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(proxyExports);␊ ␊ t.is(dep, 'default');␊ `, @@ -8097,17 +10323,33 @@ Generated by [AVA](https://avajs.dev). ␊ var entry$1 = {};␊ ␊ - Object.defineProperty(entry$1, '__esModule', { value: true });␊ - entry$1.default = 'default';␊ + var hasRequiredEntry;␊ + ␊ + function requireEntry () {␊ + if (hasRequiredEntry) return entry$1;␊ + hasRequiredEntry = 1;␊ + Object.defineProperty(entry$1, '__esModule', { value: true });␊ + entry$1.default = 'default';␊ + return entry$1;␊ + }␊ + ␊ + var proxy$1;␊ + var hasRequiredProxy;␊ ␊ - var proxy = entry$1;␊ + function requireProxy () {␊ + if (hasRequiredProxy) return proxy$1;␊ + hasRequiredProxy = 1;␊ + proxy$1 = requireEntry();␊ + return proxy$1;␊ + }␊ ␊ - var proxy$1 = /*@__PURE__*/getDefaultExportFromCjs(proxy);␊ + var proxyExports = requireProxy();␊ + var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxyExports);␊ ␊ var entry = /*#__PURE__*/_mergeNamespaces({␊ __proto__: null,␊ - default: proxy$1␊ - }, [proxy]);␊ + default: proxy␊ + }, [proxyExports]);␊ ␊ t.deepEqual(entry, { default: 'default' });␊ `, @@ -8141,18 +10383,34 @@ Generated by [AVA](https://avajs.dev). ␊ var entry$1 = {};␊ ␊ - Object.defineProperty(entry$1, '__esModule', { value: true });␊ - entry$1.default = 'default';␊ - entry$1.named = 'named';␊ + var hasRequiredEntry;␊ + ␊ + function requireEntry () {␊ + if (hasRequiredEntry) return entry$1;␊ + hasRequiredEntry = 1;␊ + Object.defineProperty(entry$1, '__esModule', { value: true });␊ + entry$1.default = 'default';␊ + entry$1.named = 'named';␊ + return entry$1;␊ + }␊ + ␊ + var proxy$1;␊ + var hasRequiredProxy;␊ ␊ - var proxy = entry$1;␊ + function requireProxy () {␊ + if (hasRequiredProxy) return proxy$1;␊ + hasRequiredProxy = 1;␊ + proxy$1 = requireEntry();␊ + return proxy$1;␊ + }␊ ␊ - var proxy$1 = /*@__PURE__*/getDefaultExportFromCjs(proxy);␊ + var proxyExports = requireProxy();␊ + var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxyExports);␊ ␊ var entry = /*#__PURE__*/_mergeNamespaces({␊ __proto__: null,␊ - default: proxy$1␊ - }, [proxy]);␊ + default: proxy␊ + }, [proxyExports]);␊ ␊ t.deepEqual(entry, { default: 'default', named: 'named' });␊ `, @@ -8186,17 +10444,33 @@ Generated by [AVA](https://avajs.dev). ␊ var entry$1 = {};␊ ␊ - Object.defineProperty(entry$1, '__esModule', { value: true });␊ - entry$1.named = 'named';␊ + var hasRequiredEntry;␊ + ␊ + function requireEntry () {␊ + if (hasRequiredEntry) return entry$1;␊ + hasRequiredEntry = 1;␊ + Object.defineProperty(entry$1, '__esModule', { value: true });␊ + entry$1.named = 'named';␊ + return entry$1;␊ + }␊ + ␊ + var proxy$1;␊ + var hasRequiredProxy;␊ ␊ - var proxy = entry$1;␊ + function requireProxy () {␊ + if (hasRequiredProxy) return proxy$1;␊ + hasRequiredProxy = 1;␊ + proxy$1 = requireEntry();␊ + return proxy$1;␊ + }␊ ␊ - var proxy$1 = /*@__PURE__*/getDefaultExportFromCjs(proxy);␊ + var proxyExports = requireProxy();␊ + var proxy = /*@__PURE__*/getDefaultExportFromCjs(proxyExports);␊ ␊ var entry = /*#__PURE__*/_mergeNamespaces({␊ __proto__: null,␊ - default: proxy$1␊ - }, [proxy]);␊ + default: proxy␊ + }, [proxyExports]);␊ ␊ t.deepEqual(entry, {␊ default: {␊ @@ -8220,16 +10494,32 @@ Generated by [AVA](https://avajs.dev). ␊ var dep$1 = {};␊ ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - dep$1.named = 'named';␊ - dep$1.default = 'default';␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep$1, '__esModule', { value: true });␊ + dep$1.named = 'named';␊ + dep$1.default = 'default';␊ + return dep$1;␊ + }␊ + ␊ + var proxy;␊ + var hasRequiredProxy;␊ ␊ - var proxy = dep$1;␊ + function requireProxy () {␊ + if (hasRequiredProxy) return proxy;␊ + hasRequiredProxy = 1;␊ + proxy = requireDep();␊ + return proxy;␊ + }␊ ␊ - var dep = /*@__PURE__*/getDefaultExportFromCjs(proxy);␊ + var proxyExports = requireProxy();␊ + var dep = /*@__PURE__*/getDefaultExportFromCjs(proxyExports);␊ ␊ t.is(dep, 'default');␊ - t.is(proxy.named, 'named');␊ + t.is(proxyExports.named, 'named');␊ `, } @@ -8242,12 +10532,29 @@ Generated by [AVA](https://avajs.dev). ␊ var dep = {};␊ ␊ - Object.defineProperty(dep, '__esModule', { value: true });␊ - dep.named = 'named';␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep, '__esModule', { value: true });␊ + dep.named = 'named';␊ + return dep;␊ + }␊ + ␊ + var proxy;␊ + var hasRequiredProxy;␊ + ␊ + function requireProxy () {␊ + if (hasRequiredProxy) return proxy;␊ + hasRequiredProxy = 1;␊ + proxy = requireDep();␊ + return proxy;␊ + }␊ ␊ - var proxy = dep;␊ + var proxyExports = requireProxy();␊ ␊ - t.is(proxy.named, 'named');␊ + t.is(proxyExports.named, 'named');␊ `, } @@ -8258,23 +10565,44 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {};␊ + var main$1 = {};␊ ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - dep$1.named = 'named';␊ - dep$1.default = 'default';␊ + var dep = {};␊ ␊ - const dep = dep$1;␊ + var hasRequiredDep;␊ ␊ - t.deepEqual(dep, {␊ - default: 'default',␊ - named: 'named'␊ - });␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep, '__esModule', { value: true });␊ + dep.named = 'named';␊ + dep.default = 'default';␊ + return dep;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ + ␊ + t.deepEqual(dep, {␊ + default: 'default',␊ + named: 'named'␊ + });␊ + ␊ + // eslint-disable-next-line no-prototype-builtins␊ + t.is(dep.hasOwnProperty('named'), true);␊ + return main$1;␊ + }␊ ␊ - // eslint-disable-next-line no-prototype-builtins␊ - t.is(dep.hasOwnProperty('named'), true);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -8287,22 +10615,43 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ ␊ - var dep$1 = {};␊ + var main$1 = {};␊ ␊ - Object.defineProperty(dep$1, '__esModule', { value: true });␊ - dep$1.default = 'default';␊ + var dep = {};␊ ␊ - const dep = dep$1;␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + Object.defineProperty(dep, '__esModule', { value: true });␊ + dep.default = 'default';␊ + return dep;␊ + }␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const dep = requireDep();␊ + ␊ + function _interopDefault(e) {␊ + return e && e.__esModule ? e : { default: e };␊ + }␊ ␊ - function _interopDefault$1(e) {␊ - return e && e.__esModule ? e : { default: e };␊ + t.is(dep.__esModule, true);␊ + const dep__default = /* #__PURE__*/ _interopDefault(dep);␊ + t.is(dep__default.default, 'default');␊ + return main$1;␊ }␊ ␊ - t.is(dep.__esModule, true);␊ - const dep__default = /* #__PURE__*/ _interopDefault$1(dep);␊ - t.is(dep__default.default, 'default');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -8315,16 +10664,30 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ /* eslint-disable global-require */␊ ␊ - try {␊ - require('uninstalled-external-module');␊ - } catch (ignored) {␊ - /* ignore */␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + try {␊ + require('uninstalled-external-module');␊ + } catch (ignored) {␊ + /* ignore */␊ + }␊ + return main$1;␊ }␊ ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ module.exports = main;␊ `, } @@ -8336,16 +10699,30 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ /* eslint-disable global-require */␊ ␊ - try {␊ - require('uninstalled-external-module');␊ - } catch (ignored) {␊ - /* ignore */␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + try {␊ + require('uninstalled-external-module');␊ + } catch (ignored) {␊ + /* ignore */␊ + }␊ + return main$1;␊ }␊ ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ module.exports = main;␊ `, } @@ -8357,16 +10734,30 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ /* eslint-disable global-require */␊ ␊ - try {␊ - require('uninstalled-external-module');␊ - } catch (ignored) {␊ - /* ignore */␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + try {␊ + require('uninstalled-external-module');␊ + } catch (ignored) {␊ + /* ignore */␊ + }␊ + return main$1;␊ }␊ ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ module.exports = main;␊ `, } @@ -8378,7 +10769,11 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ ␊ var dep = {};␊ ␊ @@ -8403,18 +10798,28 @@ Generated by [AVA](https://avajs.dev). ␊ /* eslint-disable global-require */␊ ␊ - try {␊ - t.is(requireDep().foo, 'foo');␊ - } catch (err) {␊ - throw new Error(\`Could not require: ${err}\`);␊ - }␊ + var hasRequiredMain;␊ ␊ - try {␊ - requireThrows();␊ - } catch (err) {␊ - t.is(err.message, 'Expected error');␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + try {␊ + t.is(requireDep().foo, 'foo');␊ + } catch (err) {␊ + throw new Error(\`Could not require: ${err}\`);␊ + }␊ + ␊ + try {␊ + requireThrows();␊ + } catch (err) {␊ + t.is(err.message, 'Expected error');␊ + }␊ + return main$1;␊ }␊ ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ module.exports = main;␊ `, } @@ -8426,7 +10831,24 @@ Generated by [AVA](https://avajs.dev). { 'main.js': `'use strict';␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + /* eslint-disable global-require */␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -8449,13 +10871,20 @@ Generated by [AVA](https://avajs.dev). ␊ var foo$1 = {exports: {}};␊ ␊ - if (typeof commonjsRequire === 'function' && commonjsRequire) {␊ - foo$1.exports = 'require detected';␊ - } else {␊ - foo$1.exports = 'could not detect require';␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1.exports;␊ + hasRequiredFoo = 1;␊ + if (typeof commonjsRequire === 'function' && commonjsRequire) {␊ + foo$1.exports = 'require detected';␊ + } else {␊ + foo$1.exports = 'could not detect require';␊ + }␊ + return foo$1.exports;␊ }␊ ␊ - var fooExports = foo$1.exports;␊ + var fooExports = requireFoo();␊ var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ ␊ t.is(foo, 'require detected');␊ @@ -8479,13 +10908,20 @@ Generated by [AVA](https://avajs.dev). ␊ var foo$1 = {exports: {}};␊ ␊ - if (typeof commonjsRequire === 'function' && commonjsRequire) {␊ - foo$1.exports = 1;␊ - } else {␊ - foo$1.exports = 2;␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1.exports;␊ + hasRequiredFoo = 1;␊ + if (typeof commonjsRequire === 'function' && commonjsRequire) {␊ + foo$1.exports = 1;␊ + } else {␊ + foo$1.exports = 2;␊ + }␊ + return foo$1.exports;␊ }␊ ␊ - var fooExports = foo$1.exports;␊ + var fooExports = requireFoo();␊ var foo = /*@__PURE__*/getDefaultExportFromCjs(fooExports);␊ ␊ t.is(foo, 1);␊ @@ -8505,11 +10941,25 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);␊ ␊ - var main = {};␊ + function getDefaultExportFromCjs (x) {␊ + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ + }␊ + ␊ + var main$1 = {};␊ + ␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const path = require$$0__default.default;␊ ␊ - const path = require$$0__default.default;␊ + t.is(typeof path.resolve, 'function');␊ + return main$1;␊ + }␊ ␊ - t.is(typeof path.resolve, 'function');␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ module.exports = main;␊ `, @@ -8526,14 +10976,31 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var foo$1 = 21;␊ + var foo;␊ + var hasRequiredFoo;␊ + ␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo;␊ + hasRequiredFoo = 1;␊ + foo = 21;␊ + return foo;␊ + }␊ + ␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - const foo = foo$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const foo = requireFoo();␊ ␊ - var main = foo * 2;␊ + main$1 = foo * 2;␊ + return main$1;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = main$1;␊ + module.exports = main;␊ `, } diff --git a/packages/commonjs/test/snapshots/function.js.snap b/packages/commonjs/test/snapshots/function.js.snap index 726565e0db9aa305323d2b4ba4538682160e8bd3..c77ecb63d2924c37f9a1eb5afbcea192d326cee0 100644 GIT binary patch literal 22420 zcmZs?Q*dTs*R37fw%xI9+qOF96Wg|J+qRRAopfy5`uqLAUA610{jP&+Rn4QjY8|X` z&oPFOx)70yosomHg*|}Cl?4VAh%IELQG&!r&JKsUm;J)cn^0ns1Rw0$>Gs8uQz!|h zkT41g=>LB}uXbuO2(C zeh_PDUq6{^h`XG~s+%*hSa*7c!5;wa8Gd-T!sQ`!2N~(KI`WUF8m$G|0~i*nweTQUq68RB5_@n#ikAsb zJssHFqxiK6d%t?;R;Cm>#A8`ml-Drpwt&_`Jva~5GJTFe3@PMw>U^6u9jXOyTkte( zZjw&nAykQ?D)|FnguOvxmbJ3_EgygP>|kIO-A0ZV;@Qxmnlq^nP`9 z^?Ox1wXBB7g*|J!kZ@iBERJ6L#)h2>zEmhzVT|+gYV=GV=>(|b>j7r`s;^ho%L#UI z4-lQSe-4!2(efL4=75UY(?4mMhskN(5+J32lItTAJL5M%VB>c^4}J*})WK zA;BghcYQ;+#u8;;DS5YEtV;~Yu$f%IjvY4)YK$var`+J4opFK==N^?Ix9FCsuRcseJ7KmOs2KW25zZ|Fi8Kxw=lR&m&QFRFZx+LQp%Uc}3cRV?5eClHwY{M;rRwTb@_-Gk|_oWpZ8$53Pt5H*I`n)tyPu zrx2=CP>H6(frOaN-zpnJtb{*foNfuDuddc@Zbf71rZ==zT_U0EJSNVYQs%`uo2%MI z#oLVoNnN=yqF%Tq0g4g64TW$s_H%jPueDiEwE5&zz7gQ6*h*0hr;W4$p%1TIoEivh zv4##8a4VQFT3~G1pfAfihcB*rQR#RFJMiwrF)nSkv4JyLbVn8|j*Ku*B{N0^=Ou;# z*MOBLF4Vu~PTpcpp;W(jv9xilW*N{+^e(Q4Tfl`czV3hnsl_minjOrEEshnRRCS|4 zL@8i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~_JVwwAwxc+KK3UAQ zGl2X?Fy}>6mGY_T1b*7_kSy;etzgn_tCPkyn47nPc}t{ui}F$do%s6|%-Jg?Bdq4c z>Ar|%5Is!yML4lX>Anaj+-nGnFEzE0hUiB8(;A^0x1mBX&byJ975f@4w4g=`?AVbq zj$lS%)Ql>5nLjSgCUBTRpQH?-IY9PBbaGyWi*TX`p60X$lY~WRR&jXs`FI-oAc`|K z;&pKP4os5ys{|d5yvcx?cG&mT1ijRVx#9wR|;ssWw^ zs4;jFG){HFl@NL$JHc zu9R%%utiU+(PCamsy7Nl#fKT*c&hV?QGF;T8aLp1>}1??qr8ex@uk#w0gCJLgj*R% zx1<=ZWMk#-s1v_m!H)W(+fi;u@tl|oHc 0; i--) {␊ - const j = Math.floor(Math.random() * (i + 1));␊ - [array[i], array[j]] = [array[j], array[i]];␊ - }␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + function shuffleArray(array) {␊ + for (let i = array.length - 1; i > 0; i--) {␊ + const j = Math.floor(Math.random() * (i + 1));␊ + [array[i], array[j]] = [array[j], array[i]];␊ + }␊ + }␊ + ␊ + main$1.shuffleArray = shuffleArray;␊ + return main$1;␊ }␊ ␊ - var shuffleArray_1 = main.shuffleArray = shuffleArray;␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ exports.default = main;␊ - exports.shuffleArray = shuffleArray_1;␊ ` ## can spread an object into module.exports @@ -109,27 +140,44 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - const obj = {␊ - a: 'b',␊ - b: 'c'␊ - };␊ - ␊ - var main = {␊ - ...obj␊ - };␊ + var main$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + const obj = {␊ + a: 'b',␊ + b: 'c'␊ + };␊ + ␊ + main$1 = {␊ + ...obj␊ + };␊ + return main$1;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = main$1;␊ + module.exports = main;␊ ` ## does not transform typeof exports for mixed modules > Snapshot 1 - `var foo$1 = 21;␊ + `var foo$1;␊ + var hasRequiredFoo;␊ ␊ - const foo = foo$1;␊ + function requireFoo () {␊ + if (hasRequiredFoo) return foo$1;␊ + hasRequiredFoo = 1;␊ + foo$1 = 21;␊ + return foo$1;␊ + }␊ + ␊ + const foo = requireFoo();␊ ␊ if (typeof exports !== 'undefined') {␊ throw new Error('There should be no global exports in an ES module');␊ @@ -153,9 +201,22 @@ Generated by [AVA](https://avajs.dev). `'use strict';␊ ␊ - var dep_1 = 'cjs';␊ + var dep$1 = {};␊ + ␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep$1;␊ + hasRequiredDep = 1;␊ + dep$1.dep = 'cjs';␊ + return dep$1;␊ + }␊ + ␊ + var depExports = requireDep();␊ + ␊ + var dep = depExports.dep;␊ ␊ - module.exports = dep_1;␊ + module.exports = dep;␊ ` > Snapshot 3 @@ -224,11 +285,20 @@ Generated by [AVA](https://avajs.dev). ␊ var require$$0 = /*@__PURE__*/getAugmentedNamespace(dep$1);␊ ␊ - var main = require$$0.dep;␊ + var main$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + main$1 = require$$0.dep;␊ + return main$1;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = main$1;␊ + module.exports = main;␊ ` > Snapshot 2 @@ -241,13 +311,29 @@ Generated by [AVA](https://avajs.dev). ␊ var dep = {};␊ ␊ - dep.dep = 'cjs';␊ + var hasRequiredDep;␊ ␊ - var main = dep.dep;␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep.dep = 'cjs';␊ + return dep;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var main$1;␊ + var hasRequiredMain;␊ ␊ - module.exports = main$1;␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + main$1 = requireDep().dep;␊ + return main$1;␊ + }␊ + ␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ + ␊ + module.exports = main;␊ ` > Snapshot 3 @@ -269,11 +355,20 @@ Generated by [AVA](https://avajs.dev). return dep;␊ }␊ ␊ - var main = requireDep().dep;␊ + var main$1;␊ + var hasRequiredMain;␊ + ␊ + function requireMain () {␊ + if (hasRequiredMain) return main$1;␊ + hasRequiredMain = 1;␊ + main$1 = requireDep().dep;␊ + return main$1;␊ + }␊ ␊ - var main$1 = /*@__PURE__*/getDefaultExportFromCjs(main);␊ + var mainExports = requireMain();␊ + var main = /*@__PURE__*/getDefaultExportFromCjs(mainExports);␊ ␊ - module.exports = main$1;␊ + module.exports = main;␊ ` ## handles when a required dependency of a mixed ES module changes type @@ -327,9 +422,16 @@ Generated by [AVA](https://avajs.dev). ␊ var dep = {};␊ ␊ - dep.dep = 'cjs';␊ + var hasRequiredDep;␊ + ␊ + function requireDep () {␊ + if (hasRequiredDep) return dep;␊ + hasRequiredDep = 1;␊ + dep.dep = 'cjs';␊ + return dep;␊ + }␊ ␊ - var main = dep.dep;␊ + var main = requireDep().dep;␊ ␊ module.exports = main;␊ ` @@ -377,11 +479,20 @@ Generated by [AVA](https://avajs.dev). return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;␊ }␊ ␊ - var second = require$$0.second;␊ + var second$1;␊ + var hasRequiredSecond;␊ + ␊ + function requireSecond () {␊ + if (hasRequiredSecond) return second$1;␊ + hasRequiredSecond = 1;␊ + second$1 = require$$0.second;␊ + return second$1;␊ + }␊ ␊ - var second$1 = /*@__PURE__*/getDefaultExportFromCjs(second);␊ + var secondExports = requireSecond();␊ + var second = /*@__PURE__*/getDefaultExportFromCjs(secondExports);␊ ␊ - var main = require$$0.first + second$1;␊ + var main = require$$0.first + second;␊ ␊ module.exports = main;␊ ` diff --git a/packages/commonjs/test/snapshots/test.js.snap b/packages/commonjs/test/snapshots/test.js.snap index 7b12a297274f9ad3b65020ae9a1dd02826685ffe..d50674ef65827f57039b31315ff024538240f09c 100644 GIT binary patch literal 1708 zcmV;d22=S#RzV>d(5O<;V;z)Z|3M93-qb z`SzB`Egy>r00000000B+Sxax*Mi931Kp~=+-g}t1K}gv$9jAw)5|{@fyFdXqLDB*V z3|Cl@Lyy*6yLrI0wT%t)!(kJytktMR(^4OPl z$FjnV`Z8t|1}M9^tQ{?Cm$Tu+LjlgH38z+rqs%yk5!|{3Be&N>vB!ceLG}Kqe~7+x zQ_dulCn>rS5s!}PW6o0K^2GH?k~pIl*oCro6YjxizkEG_HjFyf*s@*_4jjM9VvaX& z-UbiWiZyGUd~!%)dULy@pCclky!>Ld&iZ2x&K79LCJEOopJ$qu(f`_*L(cclbv2~ed`R@I}^g19m^VOhr3vc zA8M-&gdV;jgjgnloQt1pKh^N_L)0v?p-lLB^)d}|a7h^df-`bq}L^~nE< zv!7s?C@=Vo3du8HI$;Y4A7si1(E=r-nq<7$QPRiiqmU4~Bu$eOecHrUy>P5PNabRs zYxSng9s?!oh(#yP5d7Jz5Y8K9hqc^8Gx<5V*4&=wqN8_rbds0D%A5BDH|cJ6kh*$_GDCxvP) zH8?=ou3}^&Wc)|>j}A(wYE$$_F-tVSbO1n`tk_9E7;aLDr84`YDzgifLyq_ool~pP z>uIO=dTpRtlC-Qw;XeJ(QU}hG;51pxK{kqEb4iisQRJ%qpgmZEN0p`h+am9;7 zh}G#=%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mu6GcoN(9+ro1 z7#5x?jLhp|a{Yr^Oy0YGsbf;L=0Q3bQ>JL}Eg4gp5TCkCn*tDp;IfJhO|aInHlFGb zg@`Znto(LkO>=0=c&Lvs)VZRY#fnj8vBUr-md^?C;MUT+sz z8pmjrh0pwHXoaU6%Y2_$klCoa`Tw+?^&w$Fj9rHaL8jPGvII?q?lnZpXu!0w3%dQE zwa)VUe79d5ZfnS?EQCrL!fXx;ozRW#4UAA6F|`#$QYQv%Y*#vl9Ht>w-~;W2YkbLy z6!RC{7?UePL5A+dlnrpKZNW|(sdwR1{Ij){*L0R5M|gXmsG%3e9Fy2Q3Pg&JG3_?M zjbIaYn$5OhIW%$)qi!qHaCp@1BL89jl9Quu*OY2LeyTS2c5HCGDivwfSA@X=m^U}e z)Gp{}aQ7-M64z@ONv0-@e>qJ_{%Mr}GHGC%fSEofbaz z@yT}@v$}csmG@b|vFsREnDm56Ow=*hA(b=f+e2F`awDlpc# ze8d6tDOwMMnDpE}R1#ZJ>iAv?t~*LDzDtSz$=j{A8dGW!n6S03~|pb168 zm_G$Qd@ItyN2UStXlF`nezDkmRmEoY%eg$wfI;C1jDro>SrjxpZa1vBuWRDkbK=ZA zq=~6x$3K$G#OW%`D`~S9ybtFq$%-_wJjt^WE8%H28-hJ;Tv=~+WFXbfMjht*^TfDtG5ch|8(GX%{+jEWD!s2>OR4!lS{=M-!4Bc{?K^CnQ^AZgVh_g zI{tg*Y@Kg?r(J?Z-YuQHTXvr9gFp3)#+gd}pEfnbzKAtMPk-UR{wtQF-k1+uoM(yt z;I0$39h#b3ayz$#P81akzuk+59i7*xgH=(BuD|HhwU*}g#dUJ6#?Z?*{3S*3f_i~v iw08Bv`R8eNe|hzWk-&DdS;$?UO8)?8D@7N|8vp>D(j9{U diff --git a/packages/commonjs/test/test.js b/packages/commonjs/test/test.js index deb0a810c..1ef56aa0d 100644 --- a/packages/commonjs/test/test.js +++ b/packages/commonjs/test/test.js @@ -286,7 +286,7 @@ test('import CommonJS module with esm property should get default export ', asyn ] }); const result2 = await executeBundle(bundle2, t); - t.is(result2.error.message, 'lib is not a function'); + t.is(result2.error.message, 'libExports is not a function'); }); test('identifies named exports from object literals', async (t) => { @@ -324,7 +324,7 @@ test('can handle parens around right have node while producing default export', plugins: [commonjs()] }); - t.is((await executeBundle(bundle, t)).exports, 42); + t.is((await executeBundle(bundle, t, { testEntry: 'index.js' })).exports, 42); }); test('typeof transforms: correct-scoping', async (t) => { @@ -333,7 +333,7 @@ test('typeof transforms: correct-scoping', async (t) => { plugins: [commonjs()] }); - t.is((await executeBundle(bundle, t)).exports, 'object'); + t.is((await executeBundle(bundle, t, { testEntry: 'correct-scoping.js' })).exports, 'object'); }); test('typeof transforms: protobuf', async (t) => { @@ -343,7 +343,7 @@ test('typeof transforms: protobuf', async (t) => { plugins: [commonjs()] }); - t.is((await executeBundle(bundle, t)).exports, true); + t.is((await executeBundle(bundle, t, { testEntry: 'protobuf.js' })).exports, true); }); test('typeof transforms: sinon', async (t) => { @@ -377,7 +377,7 @@ test('deconflicts reserved keywords', async (t) => { plugins: [commonjs()] }); - const reservedProp = (await executeBundle(bundle, t, { exports: 'named' })).exports.delete; + const reservedProp = (await executeBundle(bundle, t, { exports: 'default' })).exports.delete; t.is(reservedProp, 'foo'); }); @@ -889,9 +889,15 @@ test('handles when an imported dependency of an ES module changes type', async ( modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, ['dep.js', '\0commonjsHelpers.js', '\0dep.js?commonjs-exports']); + t.deepEqual(trackedTransforms, [ + 'dep.js', + 'main.js', + '\0dep.js?commonjs-es-import', + '\0commonjsHelpers.js', + '\0dep.js?commonjs-exports' + ]); trackedTransforms.length = 0; const cjsCode = await getCodeFromBundle(bundle); t.snapshot(cjsCode); @@ -901,7 +907,7 @@ test('handles when an imported dependency of an ES module changes type', async ( bundle = await rollup(options); t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjscjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-es-import']); + t.deepEqual(trackedTransforms, ['dep.js']); trackedTransforms.length = 0; const wrappedCode = await getCodeFromBundle(bundle); t.snapshot(wrappedCode); @@ -933,9 +939,9 @@ test('handles when an imported dependency of an ES module changes type', async ( modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js']); + t.deepEqual(trackedTransforms, ['dep.js']); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), cjsCode); @@ -944,7 +950,7 @@ test('handles when an imported dependency of an ES module changes type', async ( bundle = await rollup(options); t.is(meta.isCommonJS, false); t.deepEqual((await executeBundle(bundle, t)).exports, 'esm'); - t.deepEqual(trackedTransforms, ['dep.js']); + t.deepEqual(trackedTransforms, ['dep.js', 'main.js']); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), esCode); }); @@ -972,9 +978,15 @@ test('handles when a dynamically imported dependency of an ES module changes typ modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual(await (await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, ['dep.js', '\0commonjsHelpers.js', '\0dep.js?commonjs-exports']); + t.deepEqual(trackedTransforms, [ + 'dep.js', + 'main.js', + '\0dep.js?commonjs-es-import', + '\0commonjsHelpers.js', + '\0dep.js?commonjs-exports' + ]); trackedTransforms.length = 0; modules['dep.js'] = "exports.dep = 'cjs'; exports.dep += require('dep.js').dep;"; @@ -982,7 +994,7 @@ test('handles when a dynamically imported dependency of an ES module changes typ bundle = await rollup(options); t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual(await (await executeBundle(bundle, t)).exports, 'cjscjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-es-import']); + t.deepEqual(trackedTransforms, ['dep.js']); trackedTransforms.length = 0; resetModules(); @@ -1010,9 +1022,9 @@ test('handles when a dynamically imported dependency of an ES module changes typ modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual(await (await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js']); + t.deepEqual(trackedTransforms, ['dep.js']); trackedTransforms.length = 0; resetModules(); @@ -1020,7 +1032,7 @@ test('handles when a dynamically imported dependency of an ES module changes typ bundle = await rollup(options); t.is(meta.isCommonJS, false); t.deepEqual(await (await executeBundle(bundle, t)).exports, 'esm'); - t.deepEqual(trackedTransforms, ['dep.js']); + t.deepEqual(trackedTransforms, ['dep.js', 'main.js']); trackedTransforms.length = 0; }); @@ -1055,12 +1067,12 @@ test('handles when a required dependency of a CJS module changes type', async (t modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjs'); t.deepEqual(trackedTransforms, [ 'dep.js', 'main.js', - '\0dep.js?commonjs-proxy', + 'main.js?commonjs-entry', '\0dep.js?commonjs-exports' ]); trackedTransforms.length = 0; @@ -1072,7 +1084,7 @@ test('handles when a required dependency of a CJS module changes type', async (t bundle = await rollup(options); t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjscjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js']); + t.deepEqual(trackedTransforms, ['dep.js', 'main.js?commonjs-entry']); trackedTransforms.length = 0; const wrappedCode = await getCodeFromBundle(bundle); t.snapshot(wrappedCode); @@ -1082,7 +1094,12 @@ test('handles when a required dependency of a CJS module changes type', async (t bundle = await rollup(options); t.is(meta.isCommonJS, false); t.deepEqual((await executeBundle(bundle, t)).exports, 'esm'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-proxy']); + t.deepEqual(trackedTransforms, [ + 'dep.js', + 'main.js', + 'main.js?commonjs-entry', + '\0dep.js?commonjs-proxy' + ]); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), esCode); @@ -1091,16 +1108,21 @@ test('handles when a required dependency of a CJS module changes type', async (t bundle = await rollup(options); t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjscjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-exports']); + t.deepEqual(trackedTransforms, [ + 'dep.js', + 'main.js', + 'main.js?commonjs-entry', + '\0dep.js?commonjs-exports' + ]); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), wrappedCode); modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-proxy']); + t.deepEqual(trackedTransforms, ['dep.js', 'main.js?commonjs-entry']); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), cjsCode); @@ -1109,7 +1131,12 @@ test('handles when a required dependency of a CJS module changes type', async (t bundle = await rollup(options); t.is(meta.isCommonJS, false); t.deepEqual((await executeBundle(bundle, t)).exports, 'esm'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-proxy']); + t.deepEqual(trackedTransforms, [ + 'dep.js', + 'main.js', + 'main.js?commonjs-entry', + '\0dep.js?commonjs-proxy' + ]); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), esCode); }); @@ -1144,14 +1171,9 @@ test('handles when a required dependency of a mixed ES module changes type', asy modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, [ - 'dep.js', - 'main.js', - '\0dep.js?commonjs-proxy', - '\0dep.js?commonjs-exports' - ]); + t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-exports']); trackedTransforms.length = 0; const cjsCode = await getCodeFromBundle(bundle); t.snapshot(cjsCode); @@ -1161,7 +1183,7 @@ test('handles when a required dependency of a mixed ES module changes type', asy bundle = await rollup(options); t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjscjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js']); + t.deepEqual(trackedTransforms, ['dep.js']); trackedTransforms.length = 0; const wrappedCode = await getCodeFromBundle(bundle); t.snapshot(wrappedCode); @@ -1187,9 +1209,9 @@ test('handles when a required dependency of a mixed ES module changes type', asy modules['dep.js'] = "exports.dep = 'cjs';"; options.cache = bundle.cache; bundle = await rollup(options); - t.is(meta.isCommonJS, true); + t.is(meta.isCommonJS, 'withRequireFunction'); t.deepEqual((await executeBundle(bundle, t)).exports, 'cjs'); - t.deepEqual(trackedTransforms, ['dep.js', 'main.js', '\0dep.js?commonjs-proxy']); + t.deepEqual(trackedTransforms, ['dep.js']); trackedTransforms.length = 0; t.is(await getCodeFromBundle(bundle), cjsCode);