score:0

export const a = 2
export const b = 3
export default const c = 3

then

import c , {a, b} from "your/file"

note the use of {...} for named imports and the lack of it for default exports.

score:2

you need to both have an export default and named exports. make standalone a and b variables that you export, and that you assign to properties of the default export object.

export const a = 'a-1';
export const b = 'b-1'; 
export const exp = { a, b }; // if you want this to be a named export too
export default exp;

Related Query

More Query from same tag