avoid running Sass compilation twice
This commit is contained in:
parent
a40ef1a734
commit
fcbf9f1568
|
@ -185,9 +185,7 @@ module Middleman::Cli
|
||||||
|
|
||||||
@app.sitemap.resources.select do |resource|
|
@app.sitemap.resources.select do |resource|
|
||||||
resource.ext == '.css'
|
resource.ext == '.css'
|
||||||
end.each do |resource|
|
end.each(&method(:build_resource))
|
||||||
@rack.get(URI.escape(resource.destination_path))
|
|
||||||
end
|
|
||||||
|
|
||||||
logger.debug '== Checking for Compass sprites'
|
logger.debug '== Checking for Compass sprites'
|
||||||
|
|
||||||
|
@ -210,8 +208,15 @@ module Middleman::Cli
|
||||||
end
|
end
|
||||||
|
|
||||||
# Loop over all the paths and build them.
|
# Loop over all the paths and build them.
|
||||||
resources.each do |resource|
|
resources.reject do |resource|
|
||||||
next if @config[:glob] && !File.fnmatch(@config[:glob], resource.destination_path)
|
resource.ext == '.css'
|
||||||
|
end.each(&method(:build_resource))
|
||||||
|
|
||||||
|
::Middleman::Profiling.report('build')
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_resource(resource)
|
||||||
|
return if @config[:glob] && !File.fnmatch(@config[:glob], resource.destination_path)
|
||||||
|
|
||||||
output_path = render_to_file(resource)
|
output_path = render_to_file(resource)
|
||||||
|
|
||||||
|
@ -226,9 +231,6 @@ module Middleman::Cli
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
::Middleman::Profiling.report('build')
|
|
||||||
end
|
|
||||||
|
|
||||||
# Render a resource to a file.
|
# Render a resource to a file.
|
||||||
#
|
#
|
||||||
# @param [Middleman::Sitemap::Resource] resource
|
# @param [Middleman::Sitemap::Resource] resource
|
||||||
|
|
Loading…
Reference in a new issue