Why does the following throw a syntax error when importing an ES2015 module?
// foo.js
export const FOOS = {
A: '/a',
B: '/b',
};
// bar.js
import { FOOS: { A } } from './foo'; // Syntax Error
How can I expose constants from a module such that they are available individually (eg. import { A } from 'foo'
) and collectively as an iterable (eg. import * from './foo'
)?