Click on a task for details:
Quickly find problems and enforce personal coding style—spaces not tabs!
Use import statements to combine JS files (ES6 modules).
Make JS files smaller to reduce page-load time.
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;
CodeKit will always support these special comments. You can rely on them. That said, it's a good idea to use ES6 Modules when you can, since that's a universal standard.
Why Can't I Just Import a File Anywhere?