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

Incorrect source line reported when injecting source maps #247

Open
mrt123 opened this issue Jul 28, 2016 · 2 comments
Open

Incorrect source line reported when injecting source maps #247

mrt123 opened this issue Jul 28, 2016 · 2 comments

Comments

@mrt123
Copy link

mrt123 commented Jul 28, 2016

Source line points to root parent rule in the .less file instead to the nested rule. Unless its ':before' rule, in this case it points to actual line where rule is defined.

Example navbar.less:

@import  (reference)  "../common/common";

.ch-nav-bar {
  .leftMenu {
    i.logo {
      .chIcon();
      position: relative;
      top: 4px;
      font-size: 24px;
      margin: 7px 20px 7px 25px;
      &:before {
        content: "\f015";
      }
      &:hover {
        cursor: pointer;
      }
    }

    a {
      margin: 7px 20px;
      padding: 7px 0;
    }

  }
}

For element i:before, sourcemap indicates source line navbar.less:11 (correct behaviour)
For element i.logo sourcemap indicates source line navbar.less:3 (expected is 5)
In fact any other element underneath ch-nav-bar is reported to have rule defined on line navbar.less:3

Gulp task:

gulp.task('compile-app.css', function () {

    return gulp.src(project.LESS_FILES)
        .pipe(sourceMaps.init())
        .pipe(less())   // compatible plugin used : 'gulp-less'
        .pipe(sourceMaps.write())
        .pipe(gulp.dest(BUILD_PATH));
});
@ghost
Copy link

ghost commented Jan 9, 2019

@mrt123 Did you find a solution for this issue?

@yocontra
Copy link
Member

Can you check if this is still an issue on the new v5?

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

2 participants