Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function findEntries(entryPath){
const entries = {};
const srcDirName = entryPath + '/**/*.js';
glob.sync(srcDirName).forEach(function (filepath) {
const name = filepath.slice(filepath.indexOf('js'), -3);
entries[name] = filepath;
});
return entries;
}
const foundEntries = findEntries(config.jsPath);
for (const entryName in foundEntries) {
Encore.addEntry(entryName, foundEntries[entryName]);
}
//add shared entry
Encore.createSharedEntry('vendor', [
path.resolve(config.modulesPath, 'common.js'),
path.resolve(config.modulesPath, 'dialog.js'),
'highlight.js',
'codemirror',
'codemirror/mode/markdown/markdown.js',
'art-dialog',
'art-dialog/css/dialog.css',
'jquery-validation',
'jquery-pjax',
'bootstrap-select',
'emojione',
'twemoji',
'github-markdown-css',
'bootstrap-select/dist/css/bootstrap-select.min.css',