Open spointecker opened 6 years ago
@Ffloriel ping
Thanks for reporting the issue. Fixing the grunt plugin is my next priority.
Thanks for your time!
The plugin has been updated. The Readme contains an example of a working configuration. There is also an example here. The documentation of purgecss will soon be updated to add grunt plugin to the list.
I am still having the same result with the new version and adapted config. There is no purged.css file written
My config:
purgecss: {
app: {
options: {
content: [path + '/**/*.html.twig']
},
files: {
'purged.min.css': ['web/assets/css/app.css']
}
}
},
Output is still the same as in the opening post (the var purgecssResult = new Purgecss({...
) doesnt return anything.
Any ideas how to debug this? Is it possible to add more info output to the whole process?
Could you provide a repo that reproduce the issue? One potential reason I can think of is if the paths to the files are not correct.
Unfortunately it´s not that easy to provide an example of our grunt structure (working with subrepos...) due to its complexity.
Hi!
We noticed the same issue. We hereby confirm that no CSS file is written.
Gruntfile.js config:
purgecss: {
options: {
content: ['html/*.html']
},
verkoop: {
files: {
'css/purged.css': ['../httpdocs/verkoop.css']
}
}
}
@optimalisatie I think that could be one of two things
css/purged.css
or into the directory css
css
directory does not exist, im not sure if purgecss can create it for you I also get no file written. PurifyCSS has no trouble writing to the same path, so it's not (1). The output directory exists, so it's not (2).
purgecss: {
my_target: {
options: {
content: ['src/index.html']
},
files: {
'out.css': ['src/in.css']
}
}
}
EDIT: using the CLI revealed a thrown exception on a missing semicolon in my CSS source.
Grunt-purgecss still reported Done, without errors.
After fixing the missing semicolon, grunt-purgecss successfully wrote its output file. Looks like your error detection is incomplete.
Hi,
I just tried the plugin and recognized an error in the example you have given: I had to add a "section" and wrap the files parameter, otherwise "files" was always empty.
In addition to this, there is no file written in my case. It just stops during the purge process.
So "1" will be printed but "2" doesn´t.