This project is in maintenance mode, and it will not get any new features.
apm install on-save
Create an .on-save.json
file at the root of your project (or anywhere in the path of the files you want to watch).
For example, if you want to babelify every .js
file from src
to dist
, the .on-save.json
file content might be something like:
[
{
"srcDir": "src",
"destDir": "dist",
"files": "**/*.js",
"command": "babel ${srcFile} --out-file ${destFile}"
}
]
The content of the .on-save.json
file must be an array of objects with the following properties:
srcDir
(default to.on-save.json
's directory): The source directory.destDir
(default tosrcDir
): The destination directory.files
: The files you want to track. You can use a glob (see minimatch), or an array of globs.command
: The command to execute. You can use these variables:${srcFile}
: The input file.${destFile}
: The output file.${destFileWithoutExtension}
: The output file without the extension.
showOutput
(default tofalse
): A boolean indicating whether the output stream (stdout) should be displayed or not.showError
(default totrue
): A boolean indicating whether the error stream (stderr) should be displayed or not.
MIT