moving from require.js to .js
adjusting js according to $script