Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
itaycolabo opened this issue Mar 4, 2018 · 2 comments

Comments

@itaycolabo
Copy link

itaycolabo commented Mar 4, 2018

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 itaycolabo changed the title source maps, doesm dont work in concat uglify using useminprepare source maps, doesn't stop on breakpoints when using concat & uglify in useminprepare Mar 4, 2018
@HasiniWijerathna
Copy link

HasiniWijerathna commented Aug 13, 2019

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

@dinbtechit
Copy link

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"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants