Why does this work:
const str = 'stuff';
export {
str
};
But not this:
export default {
str: 'stuff'
};
I'd like to import it as the following:
import { str } from 'myLib';
I'd like to assign the value directly in the export and not require having to create a variable before hand.
Also when I try:
export {
str: 'stuff'
};
I get the error:
SyntaxError: /home/karlm/dev/project/ex.js: Unexpected token, expected , (41:5)
39 |
40 | export {
> 41 | str: 'stuff'
| ^
42 | };
43 |