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.

Unable to use cssnext as a processor with gulp-postcss

See original GitHub issue

I’d like to use the cssnext plugin pack with gulp-postcss, as my first processor to be followed by a set of other cherry picked postcss plugins. The trouble is that I can’t figure out how to get cssnext working with gulp-postcss. In the following code snippet I think I’m using cssnext() wrong within the processors array, but everything I’ve tried to correct it fails.

var gulp = require('gulp');
var postcss = require('gulp-postcss');
var cssnext = require('cssnext');

config = {
  cssDistPath: './dist/css',
  cssSrcGlob:  './src/css/**/*.css'
};

gulp.task('css', function () {

  var processors = [
    cssnext({
      features: {
        calc: {
            preserve: true
        }
      }
    })
  ];

  return gulp.src(config.cssSrcGlob)
    .pipe(postcss(processors))
    .pipe(gulp.dest(config.cssDistPath));

});

Do you have any suggestions on how to get this working, or a better configuration?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
w0rmcommented, Apr 8, 2015

I will take a look at this tonight

On 08 Apr 2015, at 18:09, Andrey Sitnik notifications@github.com wrote:

@w0rm can I left it on you? I need to prepare to tomorrow flight

— Reply to this email directly or view it on GitHub.

0reactions
robokumacommented, Oct 2, 2015

@TrySound thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

postcss/postcss - Gitter
hey, I'm trying to write a custom plugin to rename any class, but I can't see any changes when I'm looking at the...
Read more >
gulp: PostCSS failing - postcss version higher than version of ...
I found the answer: According to the website of cssnext, the package cssnext (which I used) is dead. The new package to use...
Read more >
gulp-postcss - npm
Start using gulp-postcss in your project by running `npm i ... gulp.task('css', function () { var plugins = [ cssnext({browsers: ['last 1 ...
Read more >
How to set up a postcss pipeline with variable sharing in gulp
The build task will look for a main.css file in the src directory, and will process that file using the processors specified (in...
Read more >
PostCSS: Sass's New Play Date - Toptal
With that being said, this does not mean that PostCSS and other CSS processors can't work together. As a matter of fact, if...
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