ES6 export equivalent for conditional static require exports?

I have seen in many projects (like React), they use require() to conditionally re-export properties like so:

// index.js

if (process.env.NODE_ENV === 'production' {
  exports = require('./cjs/react.production.min.js')
} else {
  exports = require('./cjs/react.development.js')
}

I am trying to convert this to its equivalent valid ES6 syntax, preserving individual exported members (for tree shaking).

I have tried this and it works, but you cannot import individual members:

import * as prod from './cjs/react.production.min.js'
import * as dev from './cjs/react.development.js'

let exports = {}

if (process.env.NODE_ENV === 'production') {
  exports = prod
} else {
  exports = dev
}

export default exports

Is there an equivalent for the original using valid ES6 syntax?

I suppose with a smart enough compiler, the assigned keys within the nested modules could be propagated to the top level at build time like this:

import { value_1 as prod_value_1 } from './cjs/react.production.min.js'
import { value_1 as dev_value_1 } from './cjs/react.development.js'

let value_1 = undefined

if (process.env.NODE_ENV === 'production') {
  value_1 = prod_value_1
} else {
  value_1 = dev_value_1
}

export { value_1 /* value_2, etc */ }