grunt-aem-clientlibs
A Grunt plugin to read AEM clientlibs js.txt and css.txt files out JSON object of filepaths or a concatenated file of all the files ready for use with other grunt plugins. e.g. concat, less compilation, jslint, jasmine unit tests
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-aem-clientlibs --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "aem_clientlibs" task
Overview
In your project's Gruntfile, add a section named aem_clientlibs
to the data object passed into grunt.initConfig()
.
grunt;
Options
No options yet... I'm sure as this grows it will become configurable.
Usage Examples
// GET AEM CLIENT LIB filesaem_clientlibs: tests: src: '<%= JCR_ROOT_PATH %>/etc/designs/test-website/libs' '<%= JCR_ROOT_PATH %>/etc/designs/test-website/libs.tests' dest: 'tmp/tests'
The above example will output 4 files into the tmp/tests
dir;
libs.jsonlibs.jslibs.tests.jsonlibs.tests.js
libs/js.txt
#base=scripts core/app.jscore/example.js
Outputs; libs.json
libs.js
var app = app || {};app = { var isInitialised = true; return init: isInitialised }; appexample = { var message = 'Hello World!'; return { return message } };
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
(Nothing yet)