Grunt tasks for LaxarJS

Downloads in past


141.2.0-alpha.07 years ago10 years agoMinified + gzip package size for grunt-laxar in KB


grunt-laxar Build Status
Grunt tasks for LaxarJS

grunt-laxar provides a couple of custom Grunt tasks for LaxarJS applications, plus matching default configuration for several tasks from the Grunt community.
$ grunt laxar-test laxar-build laxar-dist laxar-develop
        └─1──────┘ └─2───────┘ └─3──────┘ └─4─────────┘

  1) run widget tests
  2) generate required application artifacts, bring your own server
  3) generate an optimized version for production (may take a bit longer)
  4) do a build, then run a development server with live-reload of changes

Getting Started

This plugin requires Grunt ~0.4.4. In case you have not used Grunt before, be sure to have a look at its Getting Started guide.
To use this plugin, you first need to install it using npm:
$ npm install grunt-laxar

After that, load its tasks from your Gruntfile:
grunt.loadNpmTasks( 'grunt-laxar' );

Main Tasks

These are the bread-and-butter tasks for developing and optimizing your LaxarJS application. Usually, the only task that you will have to configure manually is laxar-configure.
These tasks form the public API for grunt-laxar, and any change in their configuration or end-result is subject to the semantic versioning of this package.


Configures all flow-based tasks and their building blocks. This is the only task that requires manual configuration (more).


Generates all artifacts that are needed to develop your application on an existing web server


dependencies and resource listings required by the LaxarJS runtime, and starts a development server with live reloading (more).


Prepares your application for production


Runs the spec tests of all widgets that are a direct part of the application


Runs the spec test of an individual widget


Obtain information about the artifacts in your application (more


Create API documentation in Markdown format (more).

Internal Building-Block Tasks

These tasks are used under the hood by the main tasks listed above.
Usually you do not need to know the details on these tasks, but sometimes you can save a few seconds by only running the sub-tasks you need, instead of the whole toolchain. The APIs of these tasks and their intermediate output is considered internal, so that behavior may change in incompatible ways between minor versions of grunt-laxar.
All of these tasks are multitasks that must be configured once for each set of flows that they may handle. Thus, If your Gruntfile contains the laxar-configure settings given above, you would (re)create the artifacts model for the main flow by executing:
grunt laxar-configure laxar-artifacts:main

The easiest way to generate the required configuration is by running laxar-configure before launching any of these tasks. The main tasks listed above do that for you out of the box.


For a given flow target, generates all artifacts that are needed to run that flow in the browser during development (more).
For a given flow target, collects all reachable artifacts and produce an
artifacts model in JSON format (more).
For a given flow target, determines static assets (JSON, CSS, HTML) from the artifacts model in order to produce a
resources listing in JSON format (more).
For a given flow target, generates an AMD module that references all direct dependencies
For a given flow target, collects and merges all
requireconfig.js files found in widgets and controls (more).
For a given flow target, generates configuration for
watch targets (more).


For a given flow target, produces optimized assets (CSS, JavaScript)
For a given flow target, uses
r.js to create an optimized JavaScript bundle (more).
For a given flow target, uses
clean-css (via cssmin) in order to create a single, optimized CSS file for each theme (more).


For a given flow target, run all widget tests
Prepares test-configuration for all widgets of the given flow
Runs pre-configured widget tests (prepared by laxar-test-configure-flow or by laxar-test-widget)

Deprecated Tasks

These tasks were originally available for LaxarJS v0.x and have similar objectives to the tasks listed above. Yhese tasks are kept for compatibility only, because they shipped with LaxarJS v1.0. It is recommended to instead use the tasks listed above, which are flow-aware and much less likely to cause CPU problems due to rampant watchers.
Merge multiple CSS files into one file. Generate a JSON mapping of files inside a specific directory tree. Generate a
RequireJS module to bootstrap AngularJS. Merges XML test results.

Third-Party Tasks

These tasks are automatically configured by
grunt-laxar to work with a LaxarJS application. Starting with grunt-laxar v1.1.0, it is recommended not to use these tasks directly but to use the main tasks above. If using these tasks directly, try not to rely on the current pre-configuration performed by grunt-laxar. In the future, configuration for these tasks may be scoped to affect only specific named targets defined by grunt-laxar This way, configuration will not influence any (alias) tasks defined by yourself.
Start a static web server. Validate files with JSHint. Run Karma
. Optimize RequireJS projects using r.js. Start a static web server. Run tasks whenever watched files change.