Add debug/production when generating javascripts

Both debug and production builds generate minified scripts.
The difference is that in debug we also generate sourcemaps.