Gulp tasks and Node utilities for LifterLMS and LifterLMS add-on development
npm install --save-dev lifterlms-lib-tasks
Create a gulpfile in the root of your project (gulpfile.js)
The file must contain, at a minimum:
var gulp = require('gulp');
require( 'lifterlms-lib-tasks' )( gulp );Create a file named .llmsconfig in the root directory of your project
Example:
{
  "build": {
    "custom": [ "custom_build_task_1", "custom_build_task_2" ]
  },
  "pot": {
    "bugReport": "https://mybugreports.tld",
    "domain": "my-text-domain",
    "dest": "i18n/",
    "jsClassname": "LLMS_SLUG_l10n",
    "jsFilename": "class-llms-slug-l10n.php",
    "jsSince": "1.0.0",
    "lastTranslator": "Jeffrey Lebowski <[email protected]>",
    "team": "Team Name <[email protected]>",
    "package": "my-package-name",
  },
  "scripts": {
    "src": [ "assets/js/\*\*/\*.js", "!assets/js/\*\*/\*.min.js" ],
    "dest": "assets/js/"
  },
  "watch": {
    "custom": [
      {
        "glob": [ "path/to/files/**.js" ],
        "tasks": [ "watch_task_1", "watch_task_2" ]
      }
    ],
  }
}
- gulp build: Run textdomain, pot, scripts, and styles tasks.
- gulp pot: Generates a- .potfile in the configured destination directory (defaults to- i18n)
- gulp scripts: Minifies unminified scripts in the configured- scripts.srcglob via uglifyjs and saves them with a- .minsuffix in the- scripts.destdirectory
- gulp styles: Compiles- .scssfiles to- .css(both minified and unminified) from the configured- styles.srcglob via gulp-sass and saves in the- styles.destdirectory.
- gulp textdomain: Ensures all WP i18n functions have the text domain specified by- pot.domain.
- gulp versioner -V X.X.X: Replaces all instances of "@deprecated [version]", "@since [version]", & "@version [version]" with the supplied version number in specifed files. Uses- versioner.srcglob. If- versioner.scriptsis true, adds glob defined in- scripts.src.
- gulp watch: Watch all configured- srcdirectories for pot, scripts, and styles tasks and re-run them on change.