title: Gulp SASS Sourcemap sources are incorrect
body: <p>I am struggling to get my SASS sourcemaps to work correctly. The problem seems to be the "sources" attribute within the sourcemap and how my SASS files are nested.</p>
  
  <p>I have a Gulp task that compiles SASS to CSS. Here is an example of that</p>
  
  <pre><code>var paths = {
      styles: {
          src: './Stylesheets/SCSS/',
          files: './Stylesheets/SCSS/**/*.scss',
          dest: './Stylesheets/CSS/'
      }
  }
  
  gulp.task('compile-sass', function (){
      return gulp.src(paths.styles.files)
          .pipe(sourcemaps.init())
          .pipe(sass({
              outputStyle: 'compressed',
              includePaths : [paths.styles.src]
          }))
          .pipe(prefix({
              browsers: ['last 2 Chrome versions'],
              cascade: false
          }))
          .pipe(sourcemaps.write('../Maps/', {
              includeContent: false,
              sourceRoot: '../SCSS'
          }))
          .pipe(gulp.dest(paths.styles.dest));
  });
  </code></pre>
  
  <p>The above works for everything else - writing maps to disk, prefixing etc. I am using latest nodejs, gulpjs and relevant npm packages.</p>
  
  <p>An example of folder/asset structure from within my Stylesheets folder:</p>
  
  <pre><code>SCSS/print.scss  
  SCSS/sectionA/style.scss  
  SCSS/sectionA/partial/_partialA.scss  
  SCSS/sectionA/partial/_partialB.scss  
  SCSS/sectionB/... etc
  </code></pre>
  
  <p>For SASS files in the root of SCSS/ the sourcemaps work properly. Chrome will show where the source styles are.</p>
  
  <p>For SASS files in a subfolder within SCSS/ the sourcemaps do not work. The problem is the "sources": attribute has the wrong file listed in it. </p>
  
  <p>The print.scss map for example will correctly have <code>"sources":["print.scss"]</code>. But sectionA/style.scss map will have <code>"sources":["style.css"]</code> instead of <code>"sources":["partial/_partialA.scss", "partial/_partialB.scss"]</code> as I would expect.</p>
  
  <p>I have confirmed moving /SCSS/sectionA/style.scss to /SCSS/style.scss and amending any import paths does solve the issue. But I need it to be nested, not in the root of /SCSS.</p>
  
  <p>If I can provide more detail please let me know. I have tried the answer from <a href="https://stackoverflow.com/questions/27094175/path-to-source-map-is-wrong">Path to source map is wrong</a> and it does not solve my issue. I have also tried manipulating <code>mapSources</code> with no avail.</p>