Closed cachaito closed 10 years ago
Just remove the map
option.
(You should also disable sourcemaps in your Sass plugin options.)
Sorry if I was not understood correctly. I have two tasks in Gruntfile.js build and default. In default i need this 'map: true' option but when I'm making a dist package for a client (build task), there is no need for creating .map for .css files.
autoprefixer: {
options: {
browsers: ['last 1 versions'],
},
dev: {
options: {
map: true
},
files: [{
expand: true,
cwd: '.tmp/styles',
src: '{,*/}*.css',
dest: '.tmp/styles'
}]
}
dist: {
files: [{
expand: true,
cwd: '.tmp/styles',
src: '{,*/}*.css',
dest: '.tmp/styles'
}]
}
}
'autoprefixer:dev' // will call ‘dev’ target
'autoprefixer' // will call ‘dist’ target (default)
Here's more about targets and task- or target-specific options: http://gruntjs.com/configuring-tasks#task-configuration-and-targets
Thank You for detailed answer Dmitry. I just wanted to avoid this syntax while "files: [{...}]" paths are the same for those tasks...
Yeah it's not DRY, but Grunt only allows to have common options, everything else must be per target.
You can use a shorter syntax for this particular case though since you specify the same destination:
dist: {
src: '.tmp/styles/{,*/}*.css'
}
Again, thank You Dmitry for clearing this case.
Have a nice day!
Hi everyone! This config works great, but how easily turn off Sass source maps feature when i use build task (this settings works on default and build tasks the same)