create-index icon indicating copy to clipboard operation
create-index copied to clipboard

There is no check if the imported file has a default.

Open Guibod opened this issue 8 years ago • 2 comments
trafficstars

Create-index is pretty dumb actually, it would try to include a file as default only if it exists and validates some naming convention. It may eventually import as default a file without default.

Guibod avatar Jan 29 '17 16:01 Guibod

I don't think this is "dumb". Project directory structure is "dumb" if index.js is used with create-index in a directory that includes files without export default.

In the above case, it would be an enhancement to throw an error. In combination with the proposed ignore configuration, it would cover all use case.

gajus avatar Jan 29 '17 16:01 gajus

If no export default is found, instead could you create import * as moduleNameHold from './moduleName.js'; export const moduleName = moduleNameHold; ?

DaveWelling avatar May 10 '18 15:05 DaveWelling