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

Added spurious css file #44

Closed lombardi-gux closed 10 years ago

lombardi-gux commented 10 years ago

I have a project, with a structure of screen shot 2014-05-14 at 3 52 45 pm

I am running a LESS task which builds 2 css files to /tmp/styles

I then have an autoprefixer task

autoprefixer: {
            options: {
                browsers: ['last 1 version', 'ie 8']
            },

            files: {
                expand: true,
                flatten: true,
                src: 'tmp/styles/{,*/}*.css',
                dest: 'tmp/styles/'
            }
        },

This works. However, if I omit the dest line, it writes one of my CSS files to the project root. Not the map file, and only the live_preview.css file.

I thought omitting that param would just write the processed css back on top of the old css files?

nDmitry commented 10 years ago

Grunt flattens the entire paths and leaves only filenames. Thus, if you have a path tmp/styles/inner/file.css, it will be tmp/styles/file.css when your dest is tmp/styles/ or just file.css when you omit the dest param.

To make it work, just remove expand, flatten and dest.