1

I'm trying to create a build config file for r.js with uglify2 as optimizer. I want to disable the drop_debugger so the debugger statement does not get removed.

Below is my build.js file, the build process works fine but the debugger statements have been removed.

Is maybe r.js removing these, what am i doing wrong ?

({
    appDir: ".",
    baseUrl: ".",
    dir: "../app-build",
    paths: {
        'css-builder': 'lib/require/css-builder'
    },
    optimize: "uglify2",
    uglify2: {
        "screw-ie8": true,
        compress: {
            sequences: true,
            dead_code: true,
            drop_debugger: false,
        }
    },

    mainConfigFile: "main.js",
    modules: [
        {
            name: "main",
            include: "signalR"
        }
    ]
})
Willem D'Haeseleer
  • 17,802
  • 6
  • 58
  • 92

1 Answers1

-1

Remove the trailing comma from:

drop_debugger: false
Stephen Rauch
  • 40,722
  • 30
  • 82
  • 105
  • Answer question if you are sure about it. Your answer is just an assumption. You mentioned that you think to remove comma. You can communicate user through comments if you need clarification – Vijayanath Viswanathan Sep 23 '17 at 14:26
  • 1
    **The trailing comma is entirely irrelevant.** If the build configuration was required to be in JSON format, then yes, the trailing comma *then* would be a problem. However, the build configuration is a JavaScript file so the trailing comma is not an issue. Moreover, if the presence or absence of a comma would make a difference, the OP would experience a hard failure (`r.js` would fail immediately with an error message and it would not produce an output), but the OP is actually getting an output file, just not with the desired features. – Louis Sep 23 '17 at 15:30