chore: re-enable react-hot-loader

This commit is contained in:
Haishan 2018-12-24 23:57:03 +08:00
parent fe5ff2da40
commit 6326af3d6c
3 changed files with 14 additions and 15 deletions

View file

@ -1,7 +1,5 @@
'use strict'; 'use strict';
// "react-hot-loader/babel"
const presets = [ const presets = [
[ [
'@babel/preset-env', '@babel/preset-env',
@ -17,6 +15,7 @@ const presets = [
]; ];
const plugins = [ const plugins = [
'react-hot-loader/babel',
[ [
'@babel/plugin-transform-runtime', '@babel/plugin-transform-runtime',
{ {

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { Provider } from 'm/store'; import { Provider } from 'm/store';
import { HashRouter as Router, Route } from 'react-router-dom'; import { HashRouter as Router, Route } from 'react-router-dom';
// import { hot } from 'react-hot-loader'; import { hot } from 'react-hot-loader/root';
// import createHistory from 'history/createHashHistory'; // import createHistory from 'history/createHashHistory';
// import createHistory from 'history/createBrowserHistory'; // import createHistory from 'history/createBrowserHistory';
import ErrorBoundary from 'c/ErrorBoundary'; import ErrorBoundary from 'c/ErrorBoundary';
@ -45,11 +45,4 @@ const Root = () => (
// <Route exact path="/__0" component={StyleGuide} /> // <Route exact path="/__0" component={StyleGuide} />
// <Route exact path="/__1" component={Loading} /> // <Route exact path="/__1" component={Loading} />
// hot export Root export default hot(Root);
// https://github.com/gaearon/react-hot-loader/tree/v4.0.1#getting-started
// RHL doesn't compatible with React Hook yet, see:
// https://github.com/gaearon/react-hot-loader/issues/1088
// after it's working, uncommment below line and remove "//" in the babelrc
// export default hot(module)(Root);
export default Root;

View file

@ -2430,7 +2430,14 @@ debug@^3.1.0:
dependencies: dependencies:
ms "^2.1.1" ms "^2.1.1"
debug@^4.0.1, debug@^4.1.0: debug@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
dependencies:
ms "^2.1.1"
debug@^4.1.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87"
integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==
@ -2919,9 +2926,9 @@ eslint-visitor-keys@^1.0.0:
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
eslint@^5.7.0: eslint@^5.7.0:
version "5.10.0" version "5.11.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.10.0.tgz#24adcbe92bf5eb1fc2d2f2b1eebe0c5e0713903a" resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.11.0.tgz#51a0e70f137a425fe044cd48273b96f28a774b1f"
integrity sha512-HpqzC+BHULKlnPwWae9MaVZ5AXJKpkxCVXQHrFaRw3hbDj26V/9ArYM4Rr/SQ8pi6qUPLXSSXC4RBJlyq2Z2OQ== integrity sha512-gbEg0ttToZPkZUv2yYjpipxuYrv/9aSSmgM4V6GkiO3u04QosHYBtduUCqLEulEg3YvNDAkk3OWzyQJ/heZ3Nw==
dependencies: dependencies:
"@babel/code-frame" "^7.0.0" "@babel/code-frame" "^7.0.0"
ajv "^6.5.3" ajv "^6.5.3"