proper handling for pragmas.excludeJadeOnSave#8
proper handling for pragmas.excludeJadeOnSave#8bendi wants to merge 3 commits intodeedubs:masterfrom
Conversation
|
I'm going to have to take a closer look at this. One thing that concerns me are the updates you made directly to the Jade compiler and runtime. I would rather not have any changes to TJ's code except the last line in the compiler (around Changing TJ's code will break or greatly limit the future upgradability of this module. I'll try to make some time to play with your changes and learn a little more about using r.js to minify an app. |
|
I was just following documentation - it mentions exclueJadeOnSave but I couldn't get it working. So I figured that maybe it's missing. I also saw previous pull-merge that got rid of the local 'jade' variable completely, which in my opinion will break at runtime because of line 1033, which makes heavy use of it, inside pre-processed templates. |
|
I finally got an opportunity to minify my source for a project. I did not run into any problems in the process. I'm using Here's the relevant section from my // rjs configuration. You don't necessarily need to specify the typical
// `path` configuration, the rjs task will parse these values from your
// main module, using http://requirejs.org/docs/optimization.html#mainConfigFile
//
// name / out / mainConfig file should be used. You can let it blank if
// you're using usemin-handler to parse rjs config from markup (default
// setup)
rjs: {
// no minification, is done by the min task
// optimize: 'none',
optimize: 'uglify',
baseUrl: './javascripts',
wrap: true,
name: 'main',
pragmasOnSave: {
excludeJade : true
},
paths: {
backbone: '../components/backbone/backbone-min'
, bootstrap: '../components/bootstrap/bootstrap/js/bootstrap-min'
, jade: '../components/require-jade/jade'
, jquery: '../components/jquery/jquery.min'
, underscore: '../components/underscore/underscore-min'
, 'backbone.paginator': '../components/backbone.paginator/dist/backbone.paginator.min'
},
out: 'lessons.min.js'
},I first created a non-minified version to verify what was in there. As expected, the |
Added proper handling of pragmas.excludeJadeOnSave, thus enabling removal of runtime dependency to jade libraries. Checked against latest requirejs - works like charm :)