sternobicep
sternobicep

Reputation: 41

Middleman: Include a .scss file in the build, but do not compile it

When running the middleman build command, all the stylesheet files specified in the set :css_dir are compiled to .css extensions.

My question is: How can I exclude a .scss file from the compilation process (so that the content remains the same and doesn't compile to CSS), but can it be available in the build directory after middleman build?


A question was raised whether it's similar to ignoring the .scss files in Compass compilation: It's similar in nature, but unlike that process, which is more along the line of "ignore this file during the compilation", this question is specific to middleman, which is "ignore this file during the compilation, but do not ignore it during the build process".

Upvotes: 4

Views: 1346

Answers (1)

erotte
erotte

Reputation: 332

Yoy may use the _underscore prefix to exclude files from Sass compilation. It's intended for usage with includes/partials, but will do the job. Sass won't compile those files until you @include them.

After that, simply copy the needed files to your build directory. The :after_build hook should be the right place for that:

https://middlemanapp.com/advanced/custom_extensions/#after_build

Upvotes: 1

Related Questions