pleeease icon indicating copy to clipboard operation
pleeease copied to clipboard

I can't seem to get SourceMaps to turn off

Open gandhiShepard opened this issue 9 years ago • 5 comments

Versions: "gulp-pleeease": "^1.2.0", "gulp-sass": "^2.0.4", "gulp-sourcemaps": "^1.5.2"

// Pleeease Post-Prosessor options
var pleaseOptions  = {
  "autoprefixer": {
    "browsers": ['ie >= 8', 'ie_mob >= 10', 'ff >= 3.6', 'chrome >= 10', 'safari >= 5.1', 'opera >= 11', 'ios >= 7', 'android >= 4.1', 'bb >= 10']
  },
  "filters": true,
  "rem": true,
  "pseudoElements": true,
  "opacity": true,

  "import": false,
  "minifier": false,
  "mqpacker": true,

  "sourcemaps": false,

  "next": {
    "calc": false,
    "customProperties": false,
    "customMedia": false,
    "colors": false
  }
};


// -----------------------------------------------------------------------------
// Sass
// https://github.com/dlmanning/gulp-sass
//
gulp.task('sass', function () {
  return gulp.src(sassSrc)
    .pipe(plumber())
    .pipe(sourcemaps.init())
    .pipe(sass({
      indentedSyntax: true
    })
    .on('error', sass.logError))
    .pipe(please(pleaseOptions))
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest(dest))
    .pipe(reload({ stream: true }));
});


Am I missing something here? Thanks for Pleeease! I'm a huge fan! Stay awesome!

gandhiShepard avatar Aug 13 '15 19:08 gandhiShepard

Why setting sourcemaps: false ?

Plus, Pleeease already includes Sass, you don't need gulp-sass. Only add sass: {indentedSyntax: true} in Pleeease's options.

There's an example with Stylus from gulp-pleeease's README: https://github.com/danielhusar/gulp-pleeease#source-map-support

iamvdo avatar Aug 13 '15 20:08 iamvdo

Ok. I'll try that.

I had sourcemaps set to false to because I was using gulp-sourcemaps and I wanted and external sourcemap. However, Pleeease was inlining it even when set to false.

I'll give it a go using all of Pleease's configs. Thanks!

gandhiShepard avatar Aug 17 '15 20:08 gandhiShepard

Yeah, I can't get it to work.

adding:

"sass": {
    "indentedSyntax" : true
  } 

leads to this error

Error: Sass: parsing fails{
  "status": 1,
  "file": "stdin",
  "line": 1,
  "column": 6,
  "message": "invalid property name"
}

if I clear out the source file completely I then get this error:

Error: Sass: parsing fails{
  "status": 3,
  "message": "File context created without an input path"
}

Totally confused about this right now.

gandhiShepard avatar Sep 17 '15 19:09 gandhiShepard

The solution provided above isn't working for me. When using Pleeease for Sass (indented syntax)

"sass": {
    "indentedSyntax" : true
  },

I get more errors.

I don't think that it's picking up the indented syntax configuration

Error: Sass: parsing fails{
  "status": 1,
  "file": "stdin",
  "line": 1,
  "column": 6,
  "message": "invalid property name"
}

When I clear out the sass file used as the source, I then get this error:

Error: Sass: parsing fails{
  "status": 3,
  "message": "File context created without an input path"
}

Totally confused right now.

Also, I'm using ES6 on my gulpfile. Not sure if that matters in this case, but figure I should tell you. Thanks!

gandhiShepard avatar Sep 17 '15 19:09 gandhiShepard

Also, I found the issue with the sourcemaps not turning off. Even with sourcemaps turned to false in pleaseOptions, piping .pipe(sourcemaps.init()) will force Pleeease to output a sourcemap anyway.

.pipe(sourcemaps.init())
.pipe(sass(SassOptions))
.pipe(please(pleaseOptions))
.pipe(sourcemaps.write('./maps'))

Thus, even if I don't want to use Pleeease for sourcemaps, I still get it anyway. In the usage above, I actually get two source maps. I get an inlined one from Pleease and reference to an external one via .write('./maps').

I am using sourcemaps separately from Pleeease because I'm using it for my Sass and JS externally.Both of my Sass and JS tasks are writing external sourcemaps to a maps directory.

gandhiShepard avatar Sep 17 '15 19:09 gandhiShepard