adobe / twist-configuration

Loader for Twist configuration (.twistrc) files
Apache License 2.0
2 stars 7 forks source link

Behavior of "module" without explicit "export" key #4

Open mcav opened 6 years ago

mcav commented 6 years ago

I had originally configured the importer to treat { module: x } (with no export) as pointing to the export named "default". TwistConfiguration currently defaults "export" to the name of the item, e.g.:

"components": {
    "ccx-share-sheet": { module: "..." },
},

would default to trying to find an export named "ccx-share-sheet". Do you prefer this behavior over having the export default to "default"?

lanther commented 6 years ago

It's because in the Twist repos we use named exports from the index.js, so that's the convention I went with. I'd prefer we stick with that convention, since it encourages people to be explicit about what's supposed to be public.

Does it work when you explicitly add export: 'default'? If not, that's a bug.