nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
795 stars 60 forks source link

grunt-sass + sourcemaps #76

Closed julianxhokaxhiu closed 10 years ago

julianxhokaxhiu commented 10 years ago

Hi,

I'm actually using your plugin which is working very well, but I'm having a weird issue that maybe you can easily figure it out. So, this is my current configuration:

{
    sass: {
        options: {
            sourceMap: true
        },
        build: {
            files: 'scss/*.scss'
        }
    },
    autoprefixer: {
        options: {
            map: true,
            browsers: ['last 3 versions', 'bb 10', 'android 3']
        },
        build: {
            src: 'css/*.css'
        },
    }
}

The issue is that the sourcemaps somehow are being done, but Chrome at least cannot read them. If I disable your plugin at all ( no job task ), then sourcemaps are being loaded correctly ( the one generated by SASS).

Any clue? Thanks in advice :)

julianxhokaxhiu commented 10 years ago

Solved by myself! I've read in the autoprefixer-core issues that some other users had this issue, and it was because of spaces using the "nested" mode.

So, with this configuration, everything works :)

{
    sass: {
        options: {
            sourceMap: true,
            outputStyle: 'compressed'
        },
        build: {
            files: 'scss/*.scss'
        }
    },
    autoprefixer: {
        options: {
            map: true,
            browsers: ['last 3 versions', 'bb 10', 'android 3']
        },
        build: {
            src: 'css/*.css'
        },
    }
}