question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combined with stylus produced wrong sourcemap

See original GitHub issue

Hi! There is my config:

gulp.task('cssbuild', function () {
  gulp.src(paths.stylSrc)
    .pipe(sourcemaps.init())
    .pipe(stylus())
    .pipe(postcss([
         autoprefixer({ browsers: ['ie >= 9', 'last 2 versions'] }),
         csso()
     ]))
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(paths.output));
})

after that I get only partly work source map for example: 1461740540625

if I not use gulp-postcss or use ‘poststylus’ with autoprefixer inside (poststylus allow use postcss like stylus plugins) - everything works fine.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
w0rmcommented, Oct 23, 2016

So I investigated further, and it looks that the problem might be in the combination with postcss-csso, that is not a real postcss plugin, because it converts between different ASTs internally. Try using it as a gulp plugin gulp-csso, and include after postcss in your gulp pipeline.

Change this

var csso = require('postcss-csso');

.pipe(postcss([
         autoprefixer({browsers: ['ie >= 9', 'last 2 versions']}),
         csso()
     ]))

to this:

var csso = require('gulp-csso');

    .pipe(postcss([
         autoprefixer({browsers: ['ie >= 9', 'last 2 versions']})
     ]))
    .pipe(csso())
0reactions
aicommented, Oct 23, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

sourcemap paths are incorrect and doubled on webpack4 with ...
there is a problem with generated paths in sourcemap for stylus files, for example, with dir structure like this:
Read more >
Can't get Gulp to reference Stylus files to generate sourcemaps
I'm having issues trying to generate sourcemaps for my CSS files. My current stack is: Gulp; Stylus; Autoprefixer.
Read more >
source-map-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
What is wrong with SOURCE MAPS and how not to mess with ...
The browser first shows links to the generated code, downloading sourcemaps in the background, after which it replaces links to the source ...
Read more >
Sourcemaps - Stylus
Expressive, robust, feature-rich CSS language built for nodejs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found