What is the correct way to export a constant in ES6?
As you pointed ES6 modules
export const CONNECT_RANGE = connectRange(Range);
And when you want to consume it
import { CONNECT_RANGE } from './myModule';
export const ConnectedRange = connectRange(Range);
Is the ES modules syntax.
exports.ConnectedRange = connectRange(Range);
Is the commonJS syntax.
I would recommend using the ES modules syntax, and compiling to common JS if the environment you run your code on does not support ES modules.