Compile The tool starts by running tsc (TypeScript compiler) against all available '.ts' files.
Browserify The tool will take the single file specified in the package.json as 'main', and produce a public function for each method provided. This becomes the available API within ServiceNow
Fix block scoping issue ServiceNow has a specific issue where it doesn't hoist a function properly under certain circumstances, so we simply have to replace 'function e(...' with 'e = function(...' in the code. Not your code, it's the functions Browserify creates that cause the problem. Your code is not modified.
Uglify We run this job just to compress everything into the smallest space. The result will be placed in the './dist/deploy.js' file.
Clean Finally we clean up all the compiled '.js' files.
Run the following at the command prompt:
npm install -save servicenowify
Add the following to the 'scripts' section of your package.json:
npm run build
To configure the buildtool, a section should be added to your package.json like this:
Is it possible to specify the build order, or the jobs run? This project was built to support a certain build team. If you'd like different choices, you'll need to fork the project, change the code and do it yourself, currently I can't support this.