From 2de44cf66877957100e91d9d5797294736436b63 Mon Sep 17 00:00:00 2001 From: Rick Beerendonk Date: Sat, 31 Jan 2015 20:59:18 +0100 Subject: [PATCH] Documents that JSX tool is transforming files with .js extension (and not .jsx) by default --- docs/docs/09-tooling-integration.md | 6 +++++- npm-react-tools/README.md | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/docs/09-tooling-integration.md b/docs/docs/09-tooling-integration.md index 1814bc2ed3..02dfd0c296 100644 --- a/docs/docs/09-tooling-integration.md +++ b/docs/docs/09-tooling-integration.md @@ -32,7 +32,11 @@ If you like using JSX, we provide an in-browser JSX transformer for development ### 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 diff --git a/npm-react-tools/README.md b/npm-react-tools/README.md index 28cc47baa6..516482783a 100644 --- a/npm-react-tools/README.md +++ b/npm-react-tools/README.md @@ -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. +By default JSX files with a `.js` extension are transformed. Use the `-x` option to transform files with a `.jsx` extension. + ## Usage ### 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 -c, --config [file] JSON configuration file (no file or - means STDIN) -w, --watch Continually rebuild - -x, --extension File extension to assume when resolving module identifiers + -x, --extension File extension to assume when resolving module identifiers (default: js) --relativize Rewrite all module identifiers to be relative --follow-requires Scan modules for required dependencies --cache-dir Alternate directory to use for disk cache