3

I'm working with WebStorm 8.0.4 from jetBrain.

We are manually editing a JSON file for the labels i18n. This file has the indents and the tabs. I would like to have it minify automatically, with a file watcher. Has anyone created a plugin or created the right file watcher?

4

You can try using json-minify:

  • npm install -g json-minify

  • create a new file watcher in WebStorm, like:

    Program: /path/to/json-minify/exec, like C:\Users\user.name\AppData\Roaming\npm\json-minify.cmd

    Arguments: $FileName$

    Working dir: $FileDir$

    Output paths to refresh: $FileNameWithoutExtension$.minified.json

Make sure to tick 'Create output file from stdout' checkbox

  • 1
    Note that nodejs needs to be installed, and webstorm rebooted if nodejs was installed while webstorm was running. – David Laberge Aug 13 '14 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.