docs: function processTraceOpts(options, defaults) {
    var opts = {
      // indicate to plugins to output ES modules instead of System.register for Rollup support
      outputESM: true,
      sourceMaps: false,
  
      // conditional tracing options
      browser: undefined,
      node: undefined,
      production: undefined,
      dev: undefined,
      conditions: {
        '@system-env|default': true,
        '@system-env|~default': false
      },
      inlineConditions: {},
      traceRuntimePlugin: true,
  
      // package config tracing (used for bundles only)
      tracePackageConfig: false,
  
      // when set, automatically excludes non-file URLs that don't resolve to canonical names
      // instead of showing the "Unable to calculate canonical name" error
      excludeURLs: true,
      externals: []
    };
  
    // ensure user environment overrides default environment
    if (typeof options == 'object') {
      if (typeof options.browser == 'boolean' || typeof options.node == 'boolean') {
        // browser true/false -> node is opposite
        if (typeof options.browser == 'boolean' && typeof options.node != 'boolean')
          options.node = !options.browser;
        // node true/false -> browser is opposite
        else if (typeof options.node == 'boolean' && typeof options.browser != 'boolean')
          options.browser = !options.node;
      }
  
      // development -> dev backwards compat
      if ('development' in options)
        options.dev = options.development;
      if (typeof options.dev == 'boolean' || typeof options.production == 'boolean') {
        if (typeof options.production != 'boolean')
          options.production = !options.dev;
        if (typeof options.dev != 'boolean')
          options.dev = !options.production;
      }
    }
  
    extend(opts, defaults);
    extend(opts, options);
  
    // globalDeps are externals
    if (opts.globalDeps)
      opts.externals = opts.externals.concat(Object.keys(opts.globalDeps));
  
    // conditional tracing defaults
    if (typeof opts.browser == 'boolean') {
      // browser, node   -> browser, ~browser, node, ~node
      // !browser, node  -> ~browser, node
      // browser, !node  -> browser, ~node
      // !browser, !node -> ~browser, ~node
      opts.conditions['@system-env|browser'] = opts.browser;
      opts.conditions['@system-env|~browser'] = opts.browser === true ? opts.node : !opts.browser;
      opts.conditions['@system-env|node'] = opts.node;
      opts.conditions['@system-env|~node'] = opts.node === true ? opts.browser : !opts.node;
    }
    if (typeof opts.production == 'boolean') {
      opts.conditions['@system-env|production'] = opts.production;
      opts.conditions['@system-env|~production'] = opts.dev;
      opts.conditions['@system-env|dev'] = opts.dev;
      opts.conditions['@system-env|~dev'] = opts.production;
    }
  
    if (typeof opts.inlineConditions == 'object')
      extend(opts.conditions, opts.inlineConditions);
    else if (opts.inlineConditions === true)
      opts.inlineConditions = opts.conditions;
    else
      opts.inlineConditions = {};
  
    return opts;
  }