Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(newer): PurifyCSS doesn't work with grunt-newer #30

Open
Kristinita opened this issue Mar 11, 2018 · 0 comments
Open

bug(newer): PurifyCSS doesn't work with grunt-newer #30

Kristinita opened this issue Mar 11, 2018 · 0 comments

Comments

@Kristinita
Copy link

1. Summary

PurifyCSS doesn't work with grunt-newer for me. I get in terminal:

Warning: Cannot read property 'forEach' of undefined Use --force to continue.

Aborted due to warnings.

Many another Grunt plugins successful works with grunt-newer for me.

2. Environment

  • grunt-cli v1.2.0,
  • grunt v1.1.2,
  • grunt-purifycss 0.1.2,
  • grunt-newer 1.3.0.

3. Configuration

See example configuration in SashaGruntDebugging branch of my demo repository.

Gruntfile.coffee:

module.exports = (grunt) ->

    require('load-grunt-tasks')(grunt)

    grunt.initConfig

        purifycss:
            sashapurify:
                src: ['SashaPurify.html']
                css: ['SashaPurify.css']
                dest: 'SashaPurify.css'

SashaPurify.css:

.SashaClass {
    color: red;
}

.SashaUnusedClass {
    color: green;
}

SashaPurify.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div class="SashaClass">Sasha text</div>
</body>
</html>

4. Steps to reproduce

I run in terminal:

  1. grunt purifycss --verbose,

or

  1. grunt newer:purifycss --verbose.

5. grunt purifycss behavior

Good.

D:\SashaDemoRepositories\SashaGruntDebugging>grunt purifycss --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.coffee" Gruntfile…OK

Registering Gruntfile tasks.

Registering "grunt-newer" local Npm module tasks.
Reading D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-newer\package.json…OK
Parsing D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-newer\package.json…OK
Loading "newer.js" tasks…OK
+ any-newer, newer, newer-clean, newer-postrun

Registering "grunt-purifycss" local Npm module tasks.
Reading D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-purifycss\package.json…OK                                         4:44 PMParsing D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-purifycss\package.json…OK
Loading "purifycss.js" tasks…OK
+ purifycss
Initializing config…OK
Loading "Gruntfile.coffee" tasks…OK
>> No tasks were registered or unregistered.

Running tasks: purifycss

Running "purifycss" task

Running "purifycss:sashapurify" (purifycss) task
Verifying property purifycss.sashapurify exists in config…OK
Files: SashaPurify.html -> SashaPurify.css
Options: write=false, info
Source Files:  [ 'SashaPurify.html' ]
Style Files:  [ 'SashaPurify.css' ]

    ________________________________________________
    |
    |   PurifyCSS has reduced the file size by ~ 57.7%
    |
    ________________________________________________

Writing SashaPurify.css…OK
File "SashaPurify.css" created.

Done.

6. grunt newer:purifycss behavior

Bug.

D:\SashaDemoRepositories\SashaGruntDebugging>grunt newer:purifycss --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.coffee" Gruntfile…OK

Registering Gruntfile tasks.

Registering "grunt-newer" local Npm module tasks.
Reading D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-newer\package.json…OK
Parsing D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-newer\package.json…OK
Loading "newer.js" tasks…OK
+ any-newer, newer, newer-clean, newer-postrun

Registering "grunt-purifycss" local Npm module tasks.
Reading D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-purifycss\package.json…OK
Parsing D:\SashaDemoRepositories\SashaGruntDebugging\node_modules\grunt-purifycss\package.json…OK
Loading "purifycss.js" tasks…OK
+ purifycss
Initializing config…OK
Loading "Gruntfile.coffee" tasks…OK
>> No tasks were registered or unregistered.

Running tasks: newer:purifycss

Running "newer:purifycss" (newer) task

Running "newer:purifycss:sashapurify" (newer) task
Options: cache="D:\\SashaDemoRepositories\\SashaGruntDebugging\\node_modules\\grunt-newer\\.cache", override=undefined, tolerance=0
Files: SashaPurify.html -> SashaPurify.css

Running "purifycss:sashapurify" (purifycss) task
Verifying property purifycss.sashapurify exists in config…OK
Files: SashaPurify.html -> SashaPurify.css
Options: write=false, info
Warning: Cannot read property 'forEach' of undefined Use --force to continue.

Aborted due to warnings.

7. Not helped

I read grunt-newer description → I don't find errors in my configuration.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant