Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Add option for automated JS discovery #21

Open
mehigh opened this issue Oct 6, 2017 · 0 comments
Open

Add option for automated JS discovery #21

mehigh opened this issue Oct 6, 2017 · 0 comments
Assignees

Comments

@mehigh
Copy link
Member

mehigh commented Oct 6, 2017

Getting inspiration from this gist and using glob-fs, we could implement an option to load as entries all main.js files that appear under the provided folder structure as an option.
CC @dero / @DamianSam

var files = glob.readdirSync('./app/Resources/assets/js/**.js');
// Use each entry to build the key and add them to entries
var entries = {};
for (var i = 0, l = files.length; i < l; i++) {
    var key = files[i].replace('app/Resources/assets/js/','').replace('.js', '');
    entries[key] = source_dir + '/js/' + key;
}
@mehigh mehigh self-assigned this Oct 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant