code: function _browserReplacement(browser) {
    // string browser field is alternative main
    if (!browser || typeof browser === 'string') return {};
  
    let replacement = {};
  
    Object.keys(browser).forEach(key => {
      const target = browser[key];
  
      let sourceModule = filePathToModuleId(key);
  
      if (typeof target === 'string') {
        let targetModule = filePathToModuleId(target);
        if (!targetModule.startsWith('.')) {
          // replacement is always local
          targetModule = './' + targetModule;
        }
        replacement[sourceModule] = targetModule;
      } else {
        replacement[sourceModule] = false;
      }
    });
  
    return replacement;
  }
docs: https://github.com/defunctzombie/package-browser-field-spec