{"id":16060988,"url":"https://github.com/jetsly/ts-react-hot-transformer","last_synced_at":"2025-03-18T05:30:30.238Z","repository":{"id":57381076,"uuid":"165487862","full_name":"Jetsly/ts-react-hot-transformer","owner":"Jetsly","description":"react hot transformer for ts,and no babel","archived":false,"fork":false,"pushed_at":"2019-05-09T10:48:04.000Z","size":155,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T11:43:27.513Z","etag":null,"topics":["react-hot","react-hot-loader","ts-loader","ts-react-hot-transformer"],"latest_commit_sha":null,"homepage":"https://npm.im/ts-react-hot-transformer","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jetsly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-13T09:30:43.000Z","updated_at":"2019-03-30T21:13:14.000Z","dependencies_parsed_at":"2022-09-05T14:30:54.173Z","dependency_job_id":null,"html_url":"https://github.com/Jetsly/ts-react-hot-transformer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jetsly%2Fts-react-hot-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jetsly%2Fts-react-hot-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jetsly%2Fts-react-hot-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jetsly%2Fts-react-hot-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jetsly","download_url":"https://codeload.github.com/Jetsly/ts-react-hot-transformer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902293,"owners_count":20366260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-hot","react-hot-loader","ts-loader","ts-react-hot-transformer"],"created_at":"2024-10-09T04:07:29.565Z","updated_at":"2025-03-18T05:30:29.778Z","avatar_url":"https://github.com/Jetsly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.org/package/ts-react-hot-transformer\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/ts-react-hot-transformer.svg?style=flat\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/ts-react-hot-transformer\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/ts-react-hot-transformer.svg\" alt=\"downloads\" \u003e\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/Jetsly/ts-react-hot-transformer\"\u003e\u003cimg src=\"https://travis-ci.org/Jetsly/ts-react-hot-transformer.svg?branch=master\" alt=\"travis\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# ts-react-hot-transformer\n\n\u003e react hot transformer for ts,and no babel\n\n- **Standalone** : no babel, only configuration `ts-loader`\n\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Code Splitting](#code-splitting)\n- [License](#license)\n\n\n## Installation\n\nFor use with [node](http://nodejs.org) and [npm](https://npmjs.com):\n\n```sh\nnpm install --save-dev ts-react-hot-transformer react-hot-loader\n```\n\n## Usage\n### With ts-loader\n\n1.  Add `ts-react-hot-transformer` to your `ts-loader` options:\n\n```js\n// webpack.config.js\nconst tsReactHotTransformer = require('ts-react-hot-transformer')\n\nmodule.exports = {\n  // ...\n  module: {\n    rules: [\n      {\n        test: /\\.(jsx|tsx|js|ts)$/,\n        loader: 'ts-loader',\n        options: {\n          getCustomTransformers: () =\u003e ({\n            before: [ tsReactHotTransformer() ]\n          }),\n        },\n        exclude: /node_modules/\n      }\n    ]\n  },\n  // ...\n}\n```\n\n2.  Mark your root component as _hot-exported_:\n\n```js\n// App.js\nimport { hot } from 'react-hot-loader/root'\nconst App = () =\u003e \u003cdiv\u003eHello World!\u003c/div\u003e\nexport default hot(App)\n```\n\n\n3.  [Run webpack with Hot Module Replacement](https://webpack.js.org/guides/hot-module-replacement/#enabling-hmr):\n\n```sh\nwebpack-dev-server --hot\n```\n\n\n## Code Splitting\nIt is the same React-Dom, with the same version, to hot patch.\n\nThere is 2 ways to install it:\n\n* Use `@hot-loader/react-dom` installed instead of `react-dom`\n\n```\nyarn add @hot-loader/react-dom\n```\n\n* Use webpack **aliases**\n\n```js\n// webpack.conf\n...\nresolve: {\n    alias: {\n      'react-dom': '@hot-loader/react-dom'\n    }\n}\n...\n```\n\n\n## License\n\n[MIT License](LICENSE.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetsly%2Fts-react-hot-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetsly%2Fts-react-hot-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetsly%2Fts-react-hot-transformer/lists"}