better extension parsing for loading only JS files