gaearon / gaearon/react-hot-loader
Sucrase support
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 775
- PR merge metrics
- No merged PRs in 30d
Description
Is there any way how the hot loader could work directly with [sucrase](https://sucrase.io/)? Currently it requires the slow babel step to transpile typescript into es6 (https://github.com/alangpierce/sucrase/issues/228):
```
// Load TypeScript (.ts, .tsx).
{
test: /\.tsx?$/,
use: [
...(isDevServer
? [
{
loader: 'babel-loader',
options: {
babelrc: false,
plugins: ['react-hot-loader/babel'],
},
},
]
: []),
...(targetES6
? [
{
loader: '@sucrase/webpack-loader',
options: {
transforms: ['imports', 'jsx', 'typescript'],
},
},
]
: [{ loader: 'ts-loader', options: { configFile: paths.tsConfig } }]),
],
},
```
Contributor guide
Research direction
Start by tracing the TypeScript loader configuration shown in the issue and compare the babel-loader and @sucrase/webpack-loader paths. Done means the hot loader can work directly with Sucrase for TypeScript without requiring the slow Babel transpilation step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- babel, react, typescript, webpack
- Domain
- build-system, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100