About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:grunt

Grunt Manual

:!: Beginning with VuFind® 9.0, the use of Grunt is being phased out; it is strongly recommended that you begin using NPM Scripts instead.

Grunt is a javascript and nodejs based task runner. It has been configured to run several tasks for front end manipulation and packaging. For more advanced methods, please see our community scripts page.

To setup Grunt to run, first install node and run “npm install” to install all the dependencies in package.json.

Default

Just running “grunt” will perform the less and js compression tasks.

grunt less

Compiles all less files into a compressed css file. This script will detect themes inside of your themes directory and build the proper paths for you.

To use:

  1. grunt less
  2. adjust theme.config.php to point to new compressed file at themes/CUSTOM/css/compiled.css.

grunt scss

Compiles all sass files into a compressed css file. This script will detect themes inside of your themes directory and build the proper paths for you.

  1. grunt scss
  2. adjust theme.config.php to point to new compressed file at themes/CUSTOM/css/compiled.css.

grunt js

Compress vendor files in bootstrap3 into a single called “vendor.min.js”.

Specifically, it creates a compressed file that includes jquery, bootstrap.js, then all vendor files except for bootstrap-slider.js (not compatible with “use strict” required for compression), and finally autocomplete.js.

To compress your own code: refer to the grunt-contrib-uglify documentation or base your subtask on vendor_min. You can run specific js compression subtasks like this:

grunt uglify:vendor_min

Don't forget to update your theme.config.php.

grunt eslint

Runs eslint style checks. By default, only does bootstrap3.

grunt lessToSass

Converts all less files to sass. Mostly for the VuFind® dev team. By default does bootstrap3 and bootprint3.

development/grunt.txt · Last modified: 2023/03/22 18:25 by demiankatz