Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Purge works with CLI but not Gulp #2

Copy link
Copy link
@LukasRos

Description

@LukasRos
Issue body actions

I've encountered an issue wherein I'm trying to purge a (third-party) CSS file and I'm getting the following error:

CSS Parser Error: probably have something funny in your CSS, change it then please try again.
Reason: missing '}'
Line: 157
Column: 1
Filename: demo/test1.css

There is no missing } in the line mentioned nor anywhere else in the file as far as I'm aware. The filename is also not demo/test1.css.

Here is my Gulp code:

const gulp = require('gulp');
const concat = require('gulp-concat');
const streamqueue = require('streamqueue');
const cssPurge = require('gulp-css-purge');

// Concatenate and minify stylesheets
gulp.task('styles', function() {
    // inspired by https://stackoverflow.com/a/23507836
    return streamqueue({ objectMode: true },
        gulp.src('./node_modules/purecss/build/pure.css'),
        gulp.src('./static/app.css'),
        gulp.src('./node_modules/codemirror/lib/codemirror.css'),
    )
    .pipe(concat('styles.css'))
    .pipe(cssPurge({
        trim : true,
        shorten : true,
        verbose : false
    }))
    .pipe(gulp.dest('./static'));
});

The problem is with the ./node_modules/codemirror/lib/codemirror.css file because when I comment this line I can purge the other two without issues. The problem is also not with concatenation or the use of streamqueue because even without it I get the same error.

Now, the following run from CLI works without any problem and produces a valid minified CSS file:

./node_modules/.bin/css-purge -i ./node_modules/codemirror/lib/codemirror.css

Therefore I assume there's a problem in this package and not in css-purge itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.