Hammer Beta Support for High Sierra & Mojave Available Download.

Buy Hammer
Download
Features
Take the tour
Templates
Browse gallery
Docs
Read up
News + Updates
All the latest about Hammer

Advanced Configuration

Show Menu

Hammer.json

We've introduced an exciting new feature to Hammer, particularly for power users. Lots of people who use Hammer daily have requests that are very hard to fulfill when trying to maintain the elegance and simplicity of our mac app. So we've introduced a small json configuration file, which will sit in the root of your project, called hammer.json

hamjson@2x

There's a number of smart things you can do already with the Hammer.json file and we're looking forward to releasing more in the coming weeks. Below is the current full set of Hammer.json options.


Autoprefixer

Autoprefixer is a plugin that is part of the Post-CSS toolkit. It enables you to write your CSS rules without vendor prefixes, using current browser popularity and property support to apply prefixes for you. Working with Autoprefixer in Hammer is now super simple. You just have to enable it in your hammer.json file like this:

  
          {
            "autoprefixer":
              {
                "browsers": "last 2 versions"
              }
          }
  

Sourcemaps

If you're working with pre-compilers, like SASS and Coffeescript, you'll know that when you're looking at your code in the browser inspector, you'll see the compiled files - the css or javascript, not your original working files. This can make debugging issues very tricky, especially in production when you may have minified and combined multiple files Sourcemaps makes it possible to map back to the source, as the name suggests, to make it appear like you're running unminified and uncombined files. You can enable sourcemaps in your project with one line in your hammer.json file

        
  
          {
            "sourcemaps": true
          }
  

Forge Deployment Settings

In addition to using the simple user interface in the Hammer Mac app, you can also specify your Forge deployment settings directly in the Hammer.json file.

The forgeDeploy key will accept a string with value "true". If the value is "false" or no forgeDeploy key is present, Hammer will default to publishing to the Hammr.co service.

The forgeSiteURL key will accept a string containing the destination site name that you wish to publish to. If the site is a custom URL, write this name including the domain suffix e.g. "anvilformac.com". For Getforge.io subdomains, be sure to include the full url e.g. "anvilformac.getforge.io"

Save the Hammer.json file and your changes should also be reflected in the Mac app UI Advanced Settings.


Custom Build Folder Location

Up until now, Hammer would create a Build folder in your project where your compiled files would be located. Every aspect of this was determined by Hammer. Now you can decide both on the name of the destination build folder and it's location, both within your project or elsewhere on your file system As an example of a custom build folder location within your project directory, you can set the following in your hammer.json

        
  
          {
            "buildDir": "myFolderInsideSource",
          } 
  

If you'd prefer to have your project build folder somewhere else, on your Desktop for example, you can specify an absolute path

        
  
          {
            "buildDir": "~/Desktop/myFolderOutsideSource",
          } 
  

Have a question, want to beta test new releases or have an issue you're stuck with?

Join our supportive community Slack Team and get in touch with us directly. We love to help!

Free Trial
Buy Hammer
Anvil is a beautiful menubar app that can run your Hammer builds under local .dev URL’s - great if you’re using web services like Typekit. Find out more and download it for free at anvilformac.com