playframework - Different sbt-web pipeline task settings in development vs production? -
i sbt setting have different value when running in development (sbt run
) production (sbt dist
/ sbt start
).
specifically using sbt-uglify. use in development concatenate javascript assets 1 file. have compression , mangling disabled in development because makes code more difficult debug.
in production use compression in order remove blocks of debug code (if (debug) { ... }
) possible using dead code removal features of uglifyjs.
i expected work:
// "in assets" use uglify in dev & prod pipelinestages in assets := seq(uglify) // enable compression , mangling in prod uglifykeys.compress := true uglifykeys.mangle := true // disable in development (doesn't work! values true) uglifykeys.compress in assets := false uglifykeys.mangle in assets := false
i ended doing this
def optimize = system.getproperty("optimize") != null uglifykeys.compress := optimize uglifykeys.mangle := optimize
then can run sbt dist -j-doptimize
Comments
Post a Comment