execute modes as configure blocks

This commit is contained in:
Thomas Reynolds 2014-09-11 09:40:10 -07:00
parent e4090760e8
commit f73e89370d
2 changed files with 6 additions and 7 deletions

View file

@ -51,12 +51,12 @@
# Change the images directory # Change the images directory
# set :images_dir, "alternative_image_directory" # set :images_dir, "alternative_image_directory"
# Production build configuration # Production configuration
configure :production do configure :production do
# For example, change the Compass output style for deployment # For example, change the Compass output style for deployment
# activate :minify_css # activate :minify_css
# Minify Javascript on build # Minify Javascript
# activate :minify_javascript # activate :minify_javascript
# Enable cache buster # Enable cache buster
@ -65,11 +65,6 @@ configure :production do
# Use relative URLs # Use relative URLs
# activate :relative_assets # activate :relative_assets
# Compress PNGs after build
# First: gem install middleman-smusher
# require "middleman-smusher"
# activate :smusher
# Or use a different image path # Or use a different image path
# set :http_prefix, "/Content/images/" # set :http_prefix, "/Content/images/"
end end

View file

@ -286,7 +286,11 @@ module Middleman
config_context.instance_eval File.read(env_config), env_config, 1 config_context.instance_eval File.read(env_config), env_config, 1
end end
# Run any `configure` blocks for the current environment.
config_context.execute_configure_callbacks(config[:environment]) config_context.execute_configure_callbacks(config[:environment])
# Run any `configure` blocks for the current mode.
config_context.execute_configure_callbacks(config[:mode])
end end
def add_to_instance(name, &func) def add_to_instance(name, &func)