Features Videos Help About Updates
Menu Buy Now

Legacy JavaScript Features

First Steps
Getting Started
Live-Reload Browsers
Browser Sync
Set Language Options
Set Output Paths & Action
Second Steps
Defaults For New Projects
Build Your Project
Set Target Browsers
Stuff To Be Aware Of
CodeKit + Git
Troubleshooting
License Recovery
Tools
Autoprefixer
Babel—JS Transpiler
Terser—JS Minifier
Rollup—JS Bundler
Cache-Buster
HTML-Minifier
Bower
Libsass
Bless
Languages
Sass
Less
Stylus
JavaScript
CoffeeScript
TypeScript
Pug (Jade)
Haml
Slim
Kit
Markdown
JSON
Image Optimizers
SVG
PNG
JPEG
GIF
Frameworks
CodeKit Frameworks
Bourbon
Bourbon Neat
Bitters
Zurb Foundation
Susy
Nib
Jeet
Compass
Syntax Checkers
ESLint
JSHint
JSLint
CoffeeLint
Advanced
Hooks
Adding Custom Languages
Team Workflows
Scripting CodeKit
Editor Plugins
Coda 2
Sublime Text
Atom
More
New in 3.0
Read-Only Mode
Upgrading From 2.0
FAQ

WARNING: Deprecated

The method of combining JavaScript files discussed on this page was designed in 2010, long before JavaScript had an import statement. It was replaced in CodeKit 3.8 with ES6 Module Bundling.

For backwards compatibility, CodeKit will always retain this older JS concatenation feature, but you should NOT use it for new projects.


Combining JS Files—Legacy Method

Special Comments

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;
Details

CodeKit creates a chain of JS files based on your prepend/append statements and then simply combines the content of each file in that chain, in order. The whole chain is then processed as one giant piece of JavaScript, whether you're syntax-checking, transpiling, or minifying.

Made in San Diego, CA

Follow the Developer on Twitter

Email Support

Report a Bug

Privacy Policy