grunt-contrib-uglify icon indicating copy to clipboard operation
grunt-contrib-uglify copied to clipboard

source maps, doesn't stop on breakpoints when using concat & uglify in useminprepare

Open itaycolabo opened this issue 6 years ago • 2 comments

I am using useMin to concat and uglify my files. Everything seems to be working, the files are being concated, uglifyed and source maps are generated. The problem is - when I set breakpoints in the source code it never stops. It seems that the lines mapped between the uglifyed and the original files are incorrect. This is the grunt file configuration and versions. Anyone has an idea what is wrong here ?

Versions "grunt": "^0.4.5", "grunt-usemin": "^3.0.0", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-uglify": "^0.7.0",

Thanks.

useminPrepare: {
  html: "app/index.html",
  options: {
    dest: "dist",
    flow: {
      html: {
        steps: {
          js: ["concat", "uglifyjs"],
          css: ["cssmin"]
        },
        post: {
          js: [
            {
              name: "concat",
              createConfig: function (context) {
                context.options.generated.options = {
                  sourceMap: true
                };
              }
            },
            {
              name: "uglify",
              createConfig: function (context, block) {
                context.options.generated.options = {
                  sourceMap: true,
                  sourceMapIn: ".tmp/concat/" + block.dest.replace(".js", ".js.map")
                };
              }
            }
          ]
        }
      }
    }
  }
}

itaycolabo avatar Mar 04 '18 16:03 itaycolabo

Hi! I faced the same issue so I tried with different uglify versions. v1.0.2 works for me

HasiniWijerathna avatar Aug 13 '19 04:08 HasiniWijerathna

I am facing the same issue.. Did anyone found a solution for this?

  "devDependencies": {
    "grunt": "^1.0.1",
    "grunt-cli": "1.2.0",
    "grunt-contrib-uglify": "1.0.2",
    "grunt-contrib-less": "1.4.0",
    "grunt-contrib-watch": "1.0.0",
    "grunt-bless": "1.0.2"
  }

dinbtechit avatar Mar 13 '21 20:03 dinbtechit