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(import_demo_pkg.default());

================================================================================
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 ----------
// empty:/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(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(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(import_demo_pkg.default());

================================================================================
TestPackageJsonBrowserMapNativeModuleDisabled
---------- /Users/user/project/out.js ----------
// empty: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(import_demo_pkg.default());

================================================================================
TestPackageJsonBrowserMapRelativeDisabled
---------- /Users/user/project/out.js ----------
// empty:/Users/user/project/node_modules/demo-pkg/util-node.js
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(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(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(import_demo_pkg.default());

================================================================================
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(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(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(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(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 require_module = __commonJS((exports) => {
  __export(exports, {
    default: () => module_default
  });
  var module_default = "module";
});

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

// Users/user/project/src/test-module.js
var import_demo_pkg = __toModule(require_module());
console.log(import_demo_pkg.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());

================================================================================
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(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(import_demo_pkg.default());
