or as mentionned by @jimabramson, the use of requirejs for XBlock could also be a solution.