MCPcopy Create free account
hub / github.com/bayson/autojs / getEntry

Function getEntry

webpack.config.js:10–24  ·  view source on GitHub ↗
(globPath, options)

Source from the content-addressed store, hash-verified

8// let entry = getEntry('./src/work/**.js');
9
10function 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
26var config = {
27 entry: getEntry('./src/work/**.js'),

Callers 1

webpack.config.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected