fbpx

Gulp integration

Find out how to integrate JSQL with Gulp

Stack requirements

The JSQL Gulp plugin will not work without an account in the JSQL cloud. To learn more see overview.

Of course, to use the plugin for Gulp, your project must use the Grunt as tasks runner.

Installation

Install JSQL Gulp plugin into your frontend project using NPM:

npm install gulp-jsql --save-dev

To include gulp-jsql plugin and others plugins you should use gulp-load-plugins read more, you may install this plugin with this command:

npm install gulp-load-plugins

Plugin configuration

The plugin requires an Api Key and Dev Key.

let options = {
    apiKey: 'YOUR_API_KEY',
    src: 'src/app.js',
    dist: 'dist/app.js'
};

List of configuration parameters:

apiKey (String): your working application key from JSQL Customer Panel. See FAQ for details

src(string): file that will be processed

dist(string): output file

debug(boolean)?: optional, shows more info in console

devKeyFileName(string)?: optional, changes name of developer key file

Usage

Working solution:

let gulp = require('gulp');
let plugins = require('gulp-load-plugins')();
plugins.jsql = require('gulp-jsql');

let options = { 
apiKey: 'YOUR_API_KEY',
src: 'src/app.js',
dist: 'dist/app.js'
}; gulp.task('test', function() { plugins.jsql(options); });

Developer key

The plugin requires the file with the developer key which must be found in the directory in which Gulpfile is.

This file can be downloaded from the JSQL Customer Panel by each team member (see how to download it in FAQ ) and saved locally in the project.

We recommend that the file with the development key be added to the ignored files with the repository used (GIT, SVN etc).

Usage

Due to the multitude of configurations, we recommend only that the jsql task be connected to the process of building the application and under the process of observing changes (watcher).

Errors handling

In case of any errors the information will be shown in console.

What next?

Close Menu