Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SASS partials are not ignored when in globbing pattern #72

Closed
bvdputte opened this issue Oct 15, 2013 · 10 comments · Fixed by #80
Closed

SASS partials are not ignored when in globbing pattern #72

bvdputte opened this issue Oct 15, 2013 · 10 comments · Fixed by #80

Comments

@bvdputte
Copy link

grunt-contrib-sass is compiling my sass partials into css files even when I use the convention from the sass website ("_" in front of filename).

situation:
A folder /styles/style.scss which imports a bunch of partials from the /styles/partials/ directory. Each partial file has an underscore attached to its filename as required in the SASS convention.

When watching a SASS source folder with following globbing pattern

sass: {
options: {
    bundleExec: true,
    debugInfo: false,
    lineNumbers: false,
    loadPath: 'app/_bower_components'
},
server: {
    options: {
        lineNumbers: true
    },
    files: [{
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        src: '**/*.{scss,sass}',
        dest: '.tmp/styles',
        filter: 'isFile',
        ext: '.css'
    }]
},

it also renders each partial in the /styles/partials directory as a seperate css file. I don't believe this is expected behaviour? Or am I doing something wrong here?

PS: I know when changing the "src" property to

src: '*.{scss,sass}',

it works but sass should ignore files starting with an underscore, right?

@sindresorhus
Copy link
Member

Yup

@bvdputte
Copy link
Author

Hi Sindre,

Thanks for your reply. But what do you mean? Is it an error? Or am I doing something wrong (if so: how can I solve it)?

Thanks

@sindresorhus
Copy link
Member

It's a bug.

@andrewmartin
Copy link

Any progress on this one, or tips for globbing patterns that will ignore files starting with _?

@nschonni
Copy link
Contributor

nschonni commented Nov 2, 2013

@andrewmartin here is the basic globbing pattern to ignore the underscore files

src: [
  "**/*.scss",
  "!**/_*.scss"
]

@makabde
Copy link

makabde commented Nov 25, 2013

Same issue here
@andrewmartin I have tried your method but the partials are still not ignored. Below is the src line from my Gruntfile.

src: ["**/*/*.{scss, sass}", "!**/*/*.{scss, sass}"]

@nschonni
Copy link
Contributor

@makabde your missing the _ from the ! globbing selector.

@makabde
Copy link

makabde commented Nov 26, 2013

@nschonni Thanks for the hint.

@codepunkt
Copy link

Any progress on this one?

nschonni added a commit to nschonni/grunt-contrib-sass that referenced this issue Dec 8, 2013
This matches the expected behaviour in Ruby globbing

Fixes gruntjsgh-72
nschonni added a commit to nschonni/grunt-contrib-sass that referenced this issue Dec 8, 2013
This matches the expected behaviour in Ruby globbing

Fixes gruntjsgh-72
@codepunkt
Copy link

Very nice, was going to work on this now.

Looks good to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants