title: Gulp sourcemaps with css minify
body: <p>I put hours into this and can't really understand what's going on here. I try to <code>concat</code>, <code>minify</code> and create <code>sourcemaps</code> for my css files. I want my folder structure like this: </p>
  
  <pre><code>- Assets
  ----bundles
  --------css
  ----css
  ----maps
  --------css
  </code></pre>
  
  <p>I used lots of variations of the following code but can't get it working. For example when I use the following code:</p>
  
  <pre><code>gulp.src("./Assets/css/*.css", { base: "." })
          .pipe(sourcemaps.init())
          .pipe(concat("./Assets/bundles/css/"))
          .pipe(cssmin())
          .pipe(gulp.dest("."))
          .pipe(sourcemaps.write("./Assets/bundles/maps"))
          .pipe(gulp.dest("."));
  </code></pre>
  
  <p>This creates a folder structure as: </p>
  
  <blockquote>
    <p>./Assets/bundles/maps/Assets/bundles/css/myFile.css.map</p>
  </blockquote>
  
  <p>However, when I use </p>
  
  <pre><code>gulp.src("./Assets/css/*.css", { base: "." })
          .pipe(sourcemaps.init())
          .pipe(concat("./Assets/bundles/css/"))
          .pipe(cssmin())
          .pipe(gulp.dest("."))
          .pipe(sourcemaps.write("./css"))
          .pipe(gulp.dest("."));
  </code></pre>
  
  <p>This outputs to my root project folder like </p>
  
  <blockquote>
    <p>./css/Assets/bundles/css/myFile.css.map</p>
  </blockquote>
  
  <p>What's going on here? I tried to use gulp-rename but couldn't make it work too.</p>
  
  <p>Note: Gulp version is 3.9.1</p>