How Files Are Combined
The SuiteCommerce Advanced (SCA) source code is divided into multiple modules. These modules contain multiple subdirectories which, in turn, contain individual files, including JavaScript and Sass files. If you are implementing SCA 2019.2 or later, there are also TypeScript files which are identified with a .ts
filename extension. The contents of each of these files contains a logical structure where each element is separated by white space.
Although this organization makes the source files easy to read and understand, it is inefficient when passing these files across a network to a web browser. Most modern web applications use some method of combining multiple files spread across multiple directories into a smaller number of combined files. These files are more efficient for a web browser to load because fewer requests are required and a smaller total number of bytes are transferred.
To combine these files, SCA uses Gulp.js to perform the following tasks:
-
Determine which files need to be included in the web application.
-
Combine all of the JavaScript, Sass, and SSP library files into single files.
-
Copy any additional resources required by the application. For example, Gulp.js copies any image files, SSP files, or services.
All resources required by SCA, including combined and copied files, are stored in the Distribution directory. This directory is deployed to NetSuite. See Contents of the Deploy and Local Distribution Directories for information about the output of the gulp tasks.