- Scan for syntax errors with ESLint and other tools.
- Transpile with Babel.
- Minify with UglifyJS.
- Concatenate multiple files together (below).
Combining files reduces the number of round-trip requests between the browser and server, which makes pages load faster.
Special comments in your JS files tell CodeKit how to combine them. These comments let you prepend or append one JS file to another. They look like this:
// @codekit-prepend "someFile.js"; ... // @codekit-append "../someOtherFile.js";
You can also combine multiple files at once with a comma-separated list:
// @codekit-prepend "jQuery.js", "../otherFile.js";
The Quiet Keyword
Sometimes, you don't want the syntax checker to warn you about issues in linked files. Use the quiet keyword to automatically silence those issues:
// @codekit-prepend quiet "jQuery.js";
The keyword can appear anywhere on the special comment line and applies to all files on that line. This is equally valid:
// @codekit-prepend "jQuery.js", "otherFile.js" quiet;