1 | /* eslint-env node */
|
2 | const glob = require('glob');
|
3 | const path = require('path');
|
4 | const extname = require('path-complete-extname');
|
5 |
|
6 | module.exports = (path_to_js)=>{
|
7 | let pathToJS = path.join(...path_to_js, '*.js*')
|
8 | return glob.sync(pathToJS).reduce((map, entry)=>{
|
9 | const basename = path.basename(entry, extname(entry))
|
10 | const localMap = map
|
11 | localMap[basename] = './' + path.basename(entry)
|
12 | return localMap
|
13 | }, {})
|
14 | } |
\ | No newline at end of file |