jsoverson / preprocess

Preprocess HTML, JavaScript, and other files with directives based off custom or ENV configuration
Other
366 stars 80 forks source link

Problem with Sass files and @include #107

Open glen-84 opened 8 years ago

glen-84 commented 8 years ago

Sass (scss) files use mixins which are included using @include. If you comment-out an include, you end up with:

// @include foundation-table;

... and preprocess tries to include this as a file.

Some options that I can think of:

  1. Don't match when it contains or ends with a semi-colon.
    • Technically, a semi-colon is valid in a file name, so this isn't ideal.
  2. Don't match unless it contains a period (.).
    • A file without an extension is also technically valid, so this is also not ideal.
  3. Use a different syntax, like #include or !include.
    • This breaks the general pattern of using @, however this may be a good thing, because Sass already has @include syntax, and in fact that is valid in PHP as well.

What do you think? Do we need semi-colons in file paths/names? Do we need files without extensions? Would it make sense to make the @ prefix customizable? Any other ideas?