(globPath, options)
| 8 | // let entry = getEntry('./src/work/**.js'); |
| 9 | |
| 10 | function getEntry(globPath, options) { |
| 11 | options = options || {}; |
| 12 | var entries = {}, |
| 13 | basename, tmp, pathname; |
| 14 | |
| 15 | glob.sync(globPath, options).forEach(function (entry) { |
| 16 | pathname = entry.replace(/\.js$/,'').replace(/^\.\/src\/work\//,''); |
| 17 | let fpath = entry; |
| 18 | if(options.cwd){ |
| 19 | fpath = path.join(options.cwd, entry); |
| 20 | } |
| 21 | entries[pathname] = [fpath]; |
| 22 | }); |
| 23 | return entries; |
| 24 | } |
| 25 | |
| 26 | var config = { |
| 27 | entry: getEntry('./src/work/**.js'), |