Sha256: dbff711978f19ad312482688c9a5ea8616512b2ab733e19e8c1bf17414ce3008

Contents?: true

Size: 1.45 KB

Versions: 9

Compression:

Stored size: 1.45 KB

Contents

---
title:  Build and Serve Different Targets
layout: template-logo-medium
---

# <%= current_page.data.title %>

Learn how to build and serve different targets using `middleman-targets`, which
introduces a new CLI options to **Middleman** – `--target` – and a new
command – `build_all`.

## Build

The new `--target` option specifies the target to build. For example,

~~~ bash
bundle exec middleman build --target pro
~~~

…will build your `pro` target.

When using **Middleman** without the `--target` option, the default target
specified in your configuration will be be used.

## Build All

Instead of building each of your targets one-by-one, you can use the
`build_all` CLI command to build all targets at once:

~~~ bash
bundle exec middleman build_all
~~~

Alternatively you can simply use the alias `all` instead of `build_all`.

## Serve

Just as in building, use the `--target` CLI option:

~~~ bash
bundle exec middleman serve --target pro
~~~

And as in building, the default target will be served if the `--target` option
is not specified.


<% content_for :seeAlso do %>
<ul>
<li><a href="index.html">Welcome to middleman-targets</a></li>
<li><a href="simple-demo.html">Simple features demonstration</a></li>
<li><a href="target-feature-config.html">Configuration</a></li>
<li><a href="helpers-resources.html">Helpers and Resources</a></li>
<li><a href="frontmatter.html">Front Matter</a></li>
<li><a href="cli.html">Command Line Interface</a></li>
</ul>
<% end %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
middleman-targets-1.0.14 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.13 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.12 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.11 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.10 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.9 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.8 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.7 documentation_project/source/build-serve-targets.html.md.erb
middleman-targets-1.0.6 documentation_project/source/build-serve-targets.html.md.erb