├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── index.js
├── package.json
├── react-addons-jsx.d.ts
├── react-jsx.d.ts
└── test
├── comment.test
├── comment.test.output
├── dollar-brace.test
├── dollar-brace.test.output
├── error.test
├── error.test.output
├── es3.test
├── es3.test.output
├── es5.test
├── es5.test.output
├── generateOutputs.js
├── harmony.test
├── harmony.test.output
├── identifier.test
├── identifier.test.output
├── jsx-comment.test
├── jsx-comment.test.output
├── run.js
├── stringtemplate.test
└── stringtemplate.test.output
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | test
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## v0.2.1
4 |
5 | - Add support for embedded expressions (#12, #13)
6 |
7 | ## v0.2.0
8 |
9 | - Update to react-tools v0.13
10 | - Update definition file to work with React v0.13 definition files from DefinitelyTyped
11 | - Add support for --target (#4)
12 | - Add support for --identifier
13 |
14 | ## v0.1.2
15 |
16 | - Add support for /*jsx*/ syntax (#2)
17 |
18 | ## v0.1.1
19 |
20 | - Add support for JSX spread attributes in react-jsx.d.ts (#1)
21 |
22 | ## v0.1.0
23 |
24 | - Initial version
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 James Brantly
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ts-jsx-loader
2 |
3 | Webpack loader for transforming JSX based on special syntax. Meant to be used
4 | with a [TypeScript loader](https://github.com/jbrantly/ts-loader) to allow using JSX with TypeScript.
5 |
6 | # Important Deprecation Note
7 |
8 | Since [native JSX support](http://www.jbrantly.com/typescript-and-jsx/) is coming to TypeScript 1.6, I consider this project to be complete. No new features will be added. However, bugs will still be fixed prior to the release of TypeScript 1.6.
9 |
10 | ## Installation
11 |
12 | ```
13 | npm install ts-jsx-loader
14 | ```
15 |
16 | ## Usage
17 |
18 | The loader chain should go from ts-jsx-loader into a TypeScript loader. Your
19 | configuration will look something like this:
20 |
21 | ```javascript
22 | module.exports = {
23 | entry: './app.ts',
24 | output: {
25 | filename: 'bundle.js'
26 | },
27 | resolve: {
28 | extensions: ['', '.webpack.js', '.web.js', '.js', '.ts']
29 | },
30 | module: {
31 | loaders: [
32 | { test: /\.ts$/, loader: 'ts-loader!ts-jsx-loader' }
33 | ]
34 | }
35 | }
36 | ```
37 |
38 | ts-jsx-loader defines a fake API on React called React.jsx(). You should
39 | reference the included `react-jsx.d.ts` or `react-addons-jsx.d.ts`
40 | definition file for IDE support. This API accepts either a string or nothing.
41 | You can then create JSX as a template string or within multiline comments.
42 |
43 | ```javascript
44 | ///