gajus/create-index

How to create index of named exports?

Open

#11 aperta il 10 giu 2016

Vedi su GitHub
 (5 commenti) (2 reazioni) (0 assegnatari)JavaScript (87 fork)github user discovery
help wanted

Metriche repository

Star
 (278 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

I use webpack and babel as my es6 transpiler in my dev.create-index act correct when all siblings are files. It breaks when export subdir.

For example

├── king.js
└── queen
    ├── bar.js
    └── foo.js

create-index can correctly build index.js in dir queen

export bar from './bar.js';
export foo from './foo.js';

but in the root dir ,index.js

export queen from './queen'

just export undefined.

I found that

export * as queen from './queen';

worked.

So I forked your code and change the dir export style and committed.

https://github.com/deadivan/create-index

Please tell me if I doing something wrong.

Guida contributor