moves js into its own file