Generate JavaScript and remove unused css