Frank
Frank

Reputation: 1414

grunt/compass exclude files from compiling

I'm currently developing a magento theme. I'm using grunt-compass and grunt-watch to compile my scss files. I would like to speed up the process with excluding styles-IE8.scss for compiling (because it's not used in developing environment).

I could (of course) rename to _styles-IE8.scss and rename it back for production, but isn't there a better way to define which files to compile and which not?

Upvotes: 1

Views: 829

Answers (1)

Nick Bartlett
Nick Bartlett

Reputation: 4975

If you are using grunt-contrib-compass, in your Gruntfile.js you can use the specify option to exclude files.

Lets you specify which files you want to compile. Useful if you don't want to compile the whole folder. Globbing supported. Ignores filenames starting with underscore. Paths are relative to the Gruntfile.

ex:

compass: {
    options: {
        specify: "!/path/to/styles-IE8.scss"
    }
}

Then, depending on the environment you can set specify dynamically.

Upvotes: 2

Related Questions