Configuration
Workbench allows you to build your applications in any way you can dream up.
Thanks to the powerful and flexible configuration options that makes this possible.
These options can either be specified in a config.json
file placed in your
distribution root directory, or can be specified as commands for the grunt
executable in the terminal.
Configuration Settings
Global Configuration
The table below lists the available settings for Workbench, and the various commands
(specified on the command-line) and options
(specified in the configuration file) that control them.
Setting | Options |
---|---|
Static Root Change the directory where Workbench will serve files |
|
Data Root Change the directory where Workbench will look for data files |
|
Application Title Application name used in HTML. |
|
Defaults
|
see below |
Destination folders are cleaned on builds
The contents of dist/
are automatically
cleaned when Workbench is built. Files or folders that are not
created by Workbench will be removed. Do not use dist/
as an important location; instead, use it as a staging area and
copy files from there to another directory or web server.
Build Command Options
Setting | Commands |
---|---|
Initialize Copy third party javascript libraries and fonts to the distribution, and uglify or minimize the combined third party files into workbench.ext.min.js. |
|
Default Compile stylus files into workbench.app.min.css and workbench.min.css, jade files into workbench.app.templates.js and workbench.templates.js, and then uglify or minimize the combined templates and source javascript files into workbench.app.min.js and workbench.min.js. |
|
Regeneration Enable auto-regeneration of Workbench when files are modified. |
|
Testing Perform code style, unit and end-to-end testing. |
|
Documentation Generate both HTML and MarkDown documentation. |
|
Simple Web Server Serve and watch the configured Workbench root directory. |
|
Serve Command Options
The serve
options are listed below.
Setting | Flags |
---|---|
Local Server Port Listen on the given port. |
|
Do not use tabs in configuration files
This will either lead to parsing errors, or Workbench will revert to the default settings. Use spaces instead.
Default Configuration
Workbench runs with the following configuration options by default. Unless alternative settings for these options are explicitly specified in the configuration file, Workbench will run using these options.
Unused option
Please note that title
may or may not be used in your Workbench
application due to the fact that you may not use this element to configure
your application.
{
# Where things are
"staticRoot": "",
"dataRoot": "/data",
# Application Name
"title": "Workbench"
}