Ice Builder for Gulp
Gulp plug-in to automate the compilation of Slice files to JavaScript.
Install
npm install gulp-ice-builder --save-dev
gulp-ice-builder
calls the slice2js
compiler. You can install the latest slice2js with:
npm install slice2js --save-dev
Usage
const iceBuilder = ; gulp;
Options
String
iceHome The root directory of your Ice installation used for locating the Slice-to-JS compiler and Slice files of your Ice installation, you don't need to set it when using the slice2js npm package.
If not set, the builder will try to use the slice2js npm package.
String
iceToolsPath The directory of the slice2js
executable. This setting is ignored when using the slice2js npm package (iceHome
not set).
;
When not set <iceHome>/bin
and <iceHome>/cpp/bin
are searched for the slice2js
exectuable.
Array
include List of directories to add to Slice compiler include file search path.
;
Each directory in include
is passed to slice2js
as -I<dir>
. The Ice slice file
directory is automatically included from either the slice2js npm package or iceHome
(when set).
Array
args The list of extra arguments passed to the slice2js
compiler.
;
For a full list of arguments you can pass to the slice2js
compiler refer to slice2js.
Boolean
jsbundle Create a JavaScript bundle for each js:module
, the bundle contains the JavaScript generated
code for all the Slice compilation units that belong to a given js:module
, an extra bundled
named generated.js
is generated containing all the JavaScript generated code for Slice compilation
units that doesn't belong to any js:module
.
The jsbundle
option is enabled by default when args
contains --typescript
value. It can
be manually enabled and disabled by setting this property to true
or false
respectively.
The bundle creation uses Rollup module bundler and it requires that your Slice definitions use the es6 JavaScript module mapping introduced with Ice 3.7.
;
String
jsbundleFormat The output format use by Rollup generated bundled, it correspond to Rollup --format
option. The accepted
values are amd
, cjs
, es
, iife
and umd
. The default value is es
.
;
Boolean
jsbundleSourcemap Enable or disable the generation of source map files for the generated JavaScript bundle. The default is to
generate a source map for each generated bundled, it can be disabled by setting this option to false
.
;
Boolean
tsbundle Create a bundle containing the TypeScript declarations for each js:module
. An extra
bundle named generated.d.ts
is generated containing the TypeScript generated declarations
for Slice compilation units that do not belong to any js:module
.
;
The tsbundle
option is enabled by default when args
contains --typescript
value. It can
be manually enabled and disabled by setting this property to true
or false
respectively.