UNPKG

ys-ui-test3

Version:

A rich interaction, lightweight, high performance UI library based on Weex

24 lines (20 loc) 623 B
const uppercamelize = require('uppercamelcase'); const fs = require('fs'); const path = require('path'); function indexEntry () { const tips = `/** * Created by Tw93 on 17/09/25 */ `; const Components = fs.readdirSync(path.resolve(__dirname, '../packages')); const importList = Components.map(name => `import ${uppercamelize(name)} from './packages/${name}';`); const exportList = Components.map(name => `${uppercamelize(name)}`); const content = `${tips} ${importList.join('\n')} export { ${exportList.join(',\n ')} }; `; fs.writeFileSync(path.join(__dirname, '../index.js'), content); } indexEntry();