Documents that JSX tool is transforming files with .js extension (and not .jsx) by default

This commit is contained in:
Rick Beerendonk
2015-01-31 20:59:18 +01:00
parent a170629128
commit 2de44cf668
2 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -32,7 +32,11 @@ If you like using JSX, we provide an in-browser JSX transformer for development
### Productionizing: Precompiled JSX ### Productionizing: Precompiled JSX
If you have [npm](http://npmjs.org/), you can simply run `npm install -g react-tools` to install our command-line `jsx` tool. This tool will translate files that use JSX syntax to plain JavaScript files that can run directly in the browser. It will also watch directories for you and automatically transform files when they are changed; for example: `jsx --watch src/ build/`. Run `jsx --help` for more information on how to use this tool. If you have [npm](http://npmjs.org/), you can simply run `npm install -g react-tools` to install our command-line `jsx` tool. This tool will translate files that use JSX syntax to plain JavaScript files that can run directly in the browser. It will also watch directories for you and automatically transform files when they are changed; for example: `jsx --watch src/ build/`.
By default JSX files with a `.js` extension are transformed. Use `jsx --extension jsx src/ build/` to transform files with a `.jsx` extension.
Run `jsx --help` for more information on how to use this tool.
### Helpful Open-Source Projects ### Helpful Open-Source Projects
+3 -1
View File
@@ -6,6 +6,8 @@ This package compliments the usage of [React](http://facebook.github.io/react/).
This package installs a `jsx` executable that can be used to transform JSX into vanilla JS. This is often used as part of a build step. This transform is also exposed as an API. This package installs a `jsx` executable that can be used to transform JSX into vanilla JS. This is often used as part of a build step. This transform is also exposed as an API.
By default JSX files with a `.js` extension are transformed. Use the `-x` option to transform files with a `.jsx` extension.
## Usage ## Usage
### Command Line ### Command Line
@@ -18,7 +20,7 @@ This package installs a `jsx` executable that can be used to transform JSX into
-V, --version output the version number -V, --version output the version number
-c, --config [file] JSON configuration file (no file or - means STDIN) -c, --config [file] JSON configuration file (no file or - means STDIN)
-w, --watch Continually rebuild -w, --watch Continually rebuild
-x, --extension <js | coffee | ...> File extension to assume when resolving module identifiers -x, --extension <js | coffee | ...> File extension to assume when resolving module identifiers (default: js)
--relativize Rewrite all module identifiers to be relative --relativize Rewrite all module identifiers to be relative
--follow-requires Scan modules for required dependencies --follow-requires Scan modules for required dependencies
--cache-dir <directory> Alternate directory to use for disk cache --cache-dir <directory> Alternate directory to use for disk cache