11

How can I use grunt-contrib-requirejs config OR even r.js Config to not minify specific files.

I can disable minification for all files with optimize: 'none' option. But I don't know how to disable it for a single file.

  options: {                                        
      // Do not minify these files: 
      // 'jquery'
      optimize: 'none', // disables minification for all files
    }

I still want the file to be included in the final merged file (unlike empty: http://requirejs.org/docs/optimization.html#empty ), just not passed into uglify.js

4
  • Why is there no answer for this?!?! Feb 11, 2014 at 20:41
  • 3
    oh, all I needed was optimize: "none" Feb 11, 2014 at 21:13
  • As optimize: "none" is the answer, could someone post it as an answer so @basarat can accept it?
    – AliBZ
    Sep 24, 2015 at 14:25
  • As optimize: "none" is the answer, could someone post it as an answer so @basarat can accept it?
    – AliBZ
    Sep 24, 2015 at 14:26

1 Answer 1

1

In the absence of a configuration option to disable minification, I have the file excluded from the merged file generated by requirejs and then manually concatenated.

3
  • Did you mean that, the optimization tool by require js can not turn the minification off?
    – hguser
    Jun 16, 2015 at 1:10
  • 3
    It can (optimize: 'none'), but apparently it's an all-or-nothing thing. Jul 31, 2015 at 18:56
  • Yes. So I manually concatenated that file outside the workflow of minification
    – basarat
    Sep 25, 2015 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.