4 ms·
Did you manage to get hot reload working with TypeScript (without going through Babel in the middle)? Currently using webpack + typescript but still have Babel
by Keats 11y ago
Did you manage to get hot reload working with TypeScript (without going through Babel in the middle)? Currently using webpack + typescript but still have Babel in the middle for the occasional hot reload.
We could drop hot reload but it is occasionally nice
- mythz 11y agoNo I've opted to go with the least moving parts and am not using hot reloading or any runtime transpiling/transformations/etc. The TypeScript tools for Visual Studio automatically regenerates the .js file every time you save its TypeScript file so it works statically without needing any background process to monitor for changes. So my JSPM doesn't know about TypeScript, it's just loading the pre-generated .js files every time I hit refresh. If you've configured React Routing and are saving/reloading Redux state in localStorage on change it's a pretty good dev experience as most of the time a refresh brings you back to where you left off.
- davidspiess 11y agoLook at this recent pull request by Dan https://github.com/reactjs/redux/pull/1455 https://github.com/reactjs/redux/pull/1455 It removes the need of the hmr plugin and babel completely, since it uses webpack hot reload directly
- Keats 11y agoI've seen that before but I couldn't get the hot reload to work for the react components. You also need to `module.hot.accept` every file one by one I think?