TestPackageJsonBadMain
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/index.js
var require_demo_pkg = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_demo_pkg());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserIndexNoExt
---------- /Users/user/project/out.js ----------
// Users/user/project/src/demo-pkg/no-ext-browser/index.js
var browser = "browser";

// Users/user/project/src/demo-pkg/no-ext/index.js
var node = "node";

// Users/user/project/src/demo-pkg/ext-browser/index.js
var browser2 = "browser";

// Users/user/project/src/entry.js
console.log(browser);
console.log(node);
console.log(browser2);
console.log(browser2);

================================================================================
TestPackageJsonBrowserMapAvoidMissing
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/component-indexof/index.js
var require_component_indexof = __commonJS((exports, module) => {
  module.exports = function() {
    return 234;
  };
});

// Users/user/project/node_modules/component-classes/index.js
try {
  index = require_component_indexof();
} catch (err) {
  index = require_component_indexof();
}
var index;

================================================================================
TestPackageJsonBrowserMapModuleDisabled
---------- /Users/user/project/out.js ----------
// (disabled):Users/user/project/node_modules/node-pkg/index.js
var require_node_pkg = __commonJS(() => {
});

// Users/user/project/node_modules/demo-pkg/index.js
var require_demo_pkg = __commonJS((exports, module) => {
  var fn2 = require_node_pkg();
  module.exports = function() {
    return fn2();
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_demo_pkg());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserMapModuleToModule
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/node-pkg-browser/index.js
var require_node_pkg_browser = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/node_modules/demo-pkg/index.js
var require_demo_pkg = __commonJS((exports, module) => {
  var fn2 = require_node_pkg_browser();
  module.exports = function() {
    return fn2();
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_demo_pkg());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserMapModuleToRelative
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/node-pkg-browser.js
var require_node_pkg_browser = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/node_modules/demo-pkg/index.js
var require_demo_pkg = __commonJS((exports, module) => {
  var fn2 = require_node_pkg_browser();
  module.exports = function() {
    return fn2();
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_demo_pkg());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserMapNativeModuleDisabled
---------- /Users/user/project/out.js ----------
// (disabled):fs
var require_fs = __commonJS(() => {
});

// Users/user/project/node_modules/demo-pkg/index.js
var require_demo_pkg = __commonJS((exports, module) => {
  var fs = require_fs();
  module.exports = function() {
    return fs.readFile();
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_demo_pkg());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserMapRelativeDisabled
---------- /Users/user/project/out.js ----------
// (disabled):Users/user/project/node_modules/demo-pkg/util-node
var require_util_node = __commonJS(() => {
});

// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  var util = require_util_node();
  module.exports = function(obj) {
    return util.inspect(obj);
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserMapRelativeToModule
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/util-browser/index.js
var require_util_browser = __commonJS((exports, module) => {
  module.exports = "util-browser";
});

// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  var util = require_util_browser();
  module.exports = function() {
    return ["main", util];
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserMapRelativeToRelative
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/lib/util-browser.js
var require_util_browser = __commonJS((exports, module) => {
  module.exports = "util-browser";
});

// Users/user/project/node_modules/demo-pkg/main-browser.js
var require_main_browser = __commonJS((exports, module) => {
  var util = require_util_browser();
  module.exports = function() {
    return ["main-browser", util];
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main_browser());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserNoExt
---------- /Users/user/project/out.js ----------
// Users/user/project/src/demo-pkg/no-ext-browser.js
var browser = "browser";

// Users/user/project/src/demo-pkg/no-ext.js
var node = "node";

// Users/user/project/src/demo-pkg/ext-browser.js
var browser2 = "browser";

// Users/user/project/src/entry.js
console.log(browser);
console.log(node);
console.log(browser2);
console.log(browser2);

================================================================================
TestPackageJsonBrowserNodeModulesIndexNoExt
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/no-ext-browser/index.js
var browser = "browser";

// Users/user/project/node_modules/demo-pkg/no-ext/index.js
var node = "node";

// Users/user/project/node_modules/demo-pkg/ext-browser/index.js
var browser2 = "browser";

// Users/user/project/src/entry.js
console.log(browser);
console.log(node);
console.log(browser2);
console.log(browser2);

================================================================================
TestPackageJsonBrowserNodeModulesNoExt
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/no-ext-browser.js
var browser = "browser";

// Users/user/project/node_modules/demo-pkg/no-ext.js
var node = "node";

// Users/user/project/node_modules/demo-pkg/ext-browser.js
var browser2 = "browser";

// Users/user/project/src/entry.js
console.log(browser);
console.log(node);
console.log(browser2);
console.log(browser2);

================================================================================
TestPackageJsonBrowserOverMainNode
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserOverModuleBrowser
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.browser.js
var require_main_browser = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main_browser());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserString
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/browser.js
var require_browser = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_browser());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserWithMainNode
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonBrowserWithModuleBrowser
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.browser.esm.js
function main_browser_esm_default() {
  return 123;
}

// Users/user/project/src/entry.js
console.log(main_browser_esm_default());

================================================================================
TestPackageJsonDualPackageHazardImportAndRequireBrowser
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.browser.js
var require_main_browser = __commonJS((exports, module) => {
  module.exports = "browser main";
});

// Users/user/project/src/test-main.js
console.log(require_main_browser());

// Users/user/project/src/test-module.js
var import_demo_pkg = __toModule(require_main_browser());
console.log(import_demo_pkg.default);

================================================================================
TestPackageJsonDualPackageHazardImportAndRequireForceModuleBeforeMain
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/module.js
var module_exports = {};
__export(module_exports, {
  default: () => module_default
});
var module_default;
var init_module = __esm(() => {
  module_default = "module";
});

// Users/user/project/src/test-main.js
console.log((init_module(), module_exports));

// Users/user/project/src/test-module.js
init_module();
console.log(module_default);

================================================================================
TestPackageJsonDualPackageHazardImportAndRequireImplicitMain
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/index.js
var require_demo_pkg = __commonJS((exports, module) => {
  module.exports = "index";
});

// Users/user/project/src/test-index.js
console.log(require_demo_pkg());

// Users/user/project/src/test-module.js
var import_demo_pkg = __toModule(require_demo_pkg());
console.log(import_demo_pkg.default);

================================================================================
TestPackageJsonDualPackageHazardImportAndRequireImplicitMainForceModuleBeforeMain
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/module.js
var module_exports = {};
__export(module_exports, {
  default: () => module_default
});
var module_default;
var init_module = __esm(() => {
  module_default = "module";
});

// Users/user/project/src/test-index.js
console.log((init_module(), module_exports));

// Users/user/project/src/test-module.js
init_module();
console.log(module_default);

================================================================================
TestPackageJsonDualPackageHazardImportAndRequireSameFile
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  module.exports = "main";
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main());
console.log(import_demo_pkg.default, require_main());

================================================================================
TestPackageJsonDualPackageHazardImportAndRequireSeparateFiles
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  module.exports = "main";
});

// Users/user/project/src/test-main.js
console.log(require_main());

// Users/user/project/src/test-module.js
var import_demo_pkg = __toModule(require_main());
console.log(import_demo_pkg.default);

================================================================================
TestPackageJsonDualPackageHazardImportOnly
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/module.js
var module_default = "module";

// Users/user/project/src/entry.js
console.log(module_default);

================================================================================
TestPackageJsonDualPackageHazardRequireOnly
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  module.exports = "main";
});

// Users/user/project/src/entry.js
console.log(require_main());

================================================================================
TestPackageJsonExportsBrowser
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg/browser.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsCustomConditions
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg1/custom2.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsDefaultOverImportAndRequire
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg/default.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsImportOverRequire
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg/import.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsNeutral
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg/default.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsNode
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg/node.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsNotExactMissingExtension
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg1/dir/bar.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsOrderIndependent
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg1/2/bar.js
console.log("SUCCESS");

// Users/user/project/node_modules/pkg2/1/bar.js
console.log("SUCCESS");

================================================================================
TestPackageJsonExportsRequireOverImport
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/pkg/require.js
var require_require = __commonJS(() => {
  console.log("SUCCESS");
});

// Users/user/project/src/entry.js
require_require();

================================================================================
TestPackageJsonMain
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/custom-main.js
var require_custom_main = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_custom_main());
console.log((0, import_demo_pkg.default)());

================================================================================
TestPackageJsonMainFieldsA
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/a.js
var require_a = __commonJS((exports, module) => {
  module.exports = "a";
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_a());
console.log(import_demo_pkg.default);

================================================================================
TestPackageJsonMainFieldsB
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/b.js
var b_default = "b";

// Users/user/project/src/entry.js
console.log(b_default);

================================================================================
TestPackageJsonModule
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.esm.js
function main_esm_default() {
  return 123;
}

// Users/user/project/src/entry.js
console.log(main_esm_default());

================================================================================
TestPackageJsonNeutralExplicitMainFields
---------- /Users/user/project/out.js ----------
// Users/user/project/node_modules/demo-pkg/main.js
var require_main = __commonJS((exports, module) => {
  module.exports = function() {
    return 123;
  };
});

// Users/user/project/src/entry.js
var import_demo_pkg = __toModule(require_main());
console.log((0, import_demo_pkg.default)());
