Open immagimario opened 8 years ago
the same problem, i want use 2 postcss task, not working using dest
and src
. @nDmitry maybe @ai know ?
@immagimario i fix my problem:
postcss: {
main: {
options: {
map: false,
processors: [
require('autoprefixer')({
browsers: '> 1%'
})
]
},
src: '<%= appConfig.app %>/css/main.css'
},
new: {
options: {
map: false,
processors: [
require('autoprefixer')({
browsers: '> 10%'
})
]
},
src: './app/css/main.css',
dest: './app/css/new_main.css'
}
},
@talgautb
Hi I tried the solution that you suggested. but the console output print this error:
Running "postcss: postcss" (postcss) task
Verifying property postcss.postcss exists in config ... OK
File: [no files]
Options: processors = [], map = false, diff = false, safe = false, FailOnError = false, writeDest
I finally used this syntax:
module.exports = {
postcss {// please note: in this case this is not target name plugin name (so you can put any keyword, like: foo or dist or production etc.)
options: {
processors: [
require ('autoprefixer') ({browsers: ['last 2 versions']}),
]
},
files: {
'<% = Project.stylesheets%> / dest / main.css': '<% = project.stylesheets%> / src / main.css',
'<% = Project.stylesheets%> / dest / vendor.css': '<% = project.stylesheets%> / src / vendor.css',
}
}
};
Thank you very much for helping ;-)
I had a similar problem and this syntax worked for me, so might work for you?
module.exports = {
postcss: {
options: {
map: true,
processors: [
require ('autoprefixer') ({browsers: ['last 2 versions']}),
]
},
cwd: '<% = Project.stylesheets%>/dest/',
src: '*.css',
dest: '<% = Project.stylesheets%>/src/',
expand: true,
ext: '.css'
}
};
I installed grunt-postcss and autoprefixer plug-in, but when I try to configure PostCSS with metod of the plug-in "load-grunt-config", Autoprefixer and other plug-in, do nothing and do not have allert or error.
This is output from console:
When I configure grunt in the standard way, PostCSS it works correctly.
This is my postcss.js file, put inside of grunt folder:
Instead, with this command grunt postcss --debug, the consoole display this:
Or this command line $grunt postcss --verbose, the consoole display this:
You have no idea how to solve it
Thanks for your help
Mario