babel-changed
A command line tool that only compiles changed files with babel.
Install
Globally:
npm install -g @smpx/babel-changed
yarn global add @smpx/babel-changed
Or locally:
npm install @smpx/babel-changed --save-dev
yarn add @smpx/babel-changed --dev
Use
Default source directory is src
and default out directory is dist
babel-changed
[babel] compiling 1 files
babel-changed: 1413.925ms
See Options & Help
bebel-changed -h
Usage: babel-changed [options]
Options:
-V, --version output the version number
-s, --src [dir] Specify Source Directory (default: "src")
-d, --dest [dir] Specify Destination Directory (default: "dist")
-f, --file-glob [pattern] Glob pattern to match files in source directory (default: "**/*.*")
-i, --ignore-glob [pattern] Glob pattern to match files to ignore (default: "")
-e, --extensions <exts> Extensions to compile (comma separated) (default: ".js")
-m, --source-maps [boolean] Enable source maps (default: true)
-c, --copy [boolean] Copy files other than .js files (default: true)
-h, --help output usage information
Using with options
If your source directory is source
destination directory is out
then use
babel-changed -s source -d out
Extensions/Typescript support
For compiling TS/JSX files with babel, change the extensions to compile like below:
babel-changed -e ".js,.ts"
NOTE: Extension of compiled file will always be .js
.