简体   繁体   中英

How to use grunt sass to compile and compress scss to css?

I am trying to use grunt-contrib-sass in order to compile ...

Basically I want to achieve the following

sass --compass --force --update --style compressed --sourcemap /scss:/css

I tried the following

    sass: {
        dist: {
            options: {
                style: 'compact'
            },
            files: {
                '/css/screen.css': '/screen.scss'
            }
        }
    }

However, grunt is complainaing " Errno::EISDIR: Is a directory @ rb_sysopen "

Any idea how to fix this? It also uses compass by the way.. Do I need that defined in grunt?

I use grunt-sass as well and my usual SASS config looks like this:

client: {
    options: {
        loadPath: ['<%= config.tmp %>/styles'],
        compass: false
    },
    files: {
        '<%= config.tmp %>/styles/main.css': '<%= config.tmp %>/styles/main.scss'
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM