7

What's the best way to disable JavaScript minification in CodeKit? All those *-ck.js files it creates are making a mess of our repository's submodules.

Note that adding a rule to .gitignore doesn't work because its rules aren't inherited by submodules.

joemaller
  • 19,579
  • 7
  • 67
  • 84
  • I've since moved over to Grunt. Once grunt-watch is set up correctly, auto-reload works everywhere, including phones, iPads, and other computers. – joemaller Dec 03 '13 at 22:25

5 Answers5

2

In CodeKit Preferences select Languages / JavaScript to edit the default settings for JavaScript handling. (These can be overridden for each file in a project.)

Change the setting for the second processing step (labelled "Then:") from "Concatenate + minifiy" to "Concatenate imported files". For any script file already in the project check whether it already has individual settings which still differ from this new default.

In this case, "*-ck.js"-files should only be created in case a source file imports another for concatenation but not for ordinary script files.

Alternatively you might specify a different output path for the generated ck-Files in CodeKit Preferences / JavaScript / Output Paths in order not to let the generated files clutter the source directory.

immo
  • 61
  • 5
2

I believe the menu has been updated, but the answer from immo still stands. Under Javascript Language settings you can click a dropdown for output style and change it from minified to non-minified.

enter image description here

mcsharps
  • 71
  • 5
1

One workaround is to set the output path to something like codekit-ignore in Preferences > JavaScript > Output Paths, relative to the project's root folder.

Then add /codekit-ignore to .gitignore.

Easy to cleanup and feels better than find . -iregex '.*-ck\.js' -delete.

joemaller
  • 19,579
  • 7
  • 67
  • 84
1

In the preferences see 'Skipped Items' under 'General' and add *.js to the list.

enter image description here

  • This doesn't really work. Adding this rule to an existing project has no effect, `*.js` files are still linted and minified. True, new CodeKit projects created with this rule don't lint or minify scripts, but it also breaks auto-reload for those files. – joemaller Dec 03 '13 at 22:22
0

There are several ways to stop javascript minification in Code Kit but the easiest and simplest way to do so is simple to navigate to the javascript file you wish not to minify in the file view, and configure your Javascript Options to the right hand side.

This method provides benefits such as JSHint & JSLint without the minification and can be configured on a site by site, file by file basis giving you greater control.

Let me know if you have any further issues, i'd be happy to help.

CodeKit: JavaScript Options

Matt
  • 2,450
  • 5
  • 30
  • 36