On Wed, Nov 25, 2015 at 1:18 PM, Sam Foster <[email protected]> wrote:
> Back in the day, in the dojotookit we used a combination of feature
> detection and a require.js alike module system to build feature-specific
> sources. So rather than magic comments with preprocessor meaning, you got
> real conditionals in the code that were optimized away given a feature-set
> profile at build-time. In practice this was mostly done at a file/module
> level though - very similar to what Marcus proposes.
>
The r.js optimizer still has support for the if(has-based-id) {} style of
removal, although it is not advertised well, and it might be nice to have
it done a separate step from minification:
https://github.com/jrburke/r.js/blob/3b3f050001db43f658f0b1ad63a046e9b56283d8/build/example.build.js#L280
Scrolling above that link, you can also see the r.js support for
comment-based //>> exclude/include support.
So if your app is using r.js for build optimizations, those options are
available to try.
James
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos