1

I wanted to use the --in-source-map option that is available in UglifyJS2 for consuming a source map file and outputting a new one along with the compressed js, thereby performing a multi-level source mapping. I am using r.js to do the minification of the javascript files and so I saw there was a way to define config values that will be passed on to the UglifyJS2. Here is a sample showing how it is done in the r.js build file:

uglify2: {
    //Example of a specialized config. If you are fine
    //with the default options, no need to specify
    //any of these properties.
    output: {
        beautify: true
    },
    compress: {
        sequences: false,
        global_defs: {
            DEBUG: false
        }
    },
    warnings: true,
    mangle: false
},

Obvously r.js has its own way of structuring the config options and I was not able to figure out how to set the --in-source-map option following this structure. I tried putting the following statement in the output element or the compress element or even outside, next to the warnings config option.

in-source-map: sample.map

I have also tried putting quotes around the file name. Unfortunately none of the methods worked. Can anyone help me figure out this problem? Can it also be the case that this option is not supported in r.js?

KonyKing
  • 81
  • 1
  • 7

0 Answers0