From 80c7884e93ae58d1dec941ed543ed6b7259f796d Mon Sep 17 00:00:00 2001 From: mama Date: Mon, 9 Oct 2017 12:05:35 +0200 Subject: [PATCH] Tentative infructueuse de refaire marcher facilement le hot reloading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sur la page /regle, ce qui est très pratique pour améliorer l'affichage de l'algorithme. C'est problablement notre génération du JSX dans mecanism.js qui pose problème. https://github.com/gaearon/react-hot-loader/blob/master/docs/Troubleshooting.md --- package.json | 2 +- source/.babelrc | 1 + source/entry.js | 5 +---- source/webpack.config.js | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d07bcc146..2d5b1d5be 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "style-loader": "^0.18.2", "url-loader": "^0.5.8", "webpack": "^3.6.0", - "webpack-dev-server": "^2.4.5" + "webpack-dev-server": "^2.9.1" }, "scripts": { "start": "node source/server.js", diff --git a/source/.babelrc b/source/.babelrc index aa300bf63..9704dc308 100644 --- a/source/.babelrc +++ b/source/.babelrc @@ -14,6 +14,7 @@ "transform-object-rest-spread", "transform-class-properties", "syntax-dynamic-import", + "react-hot-loader/babel", ["webpack-alias", { "config": "./source/webpack.config.js" }] ] } diff --git a/source/entry.js b/source/entry.js index e596c39b9..720f1b49a 100644 --- a/source/entry.js +++ b/source/entry.js @@ -23,12 +23,9 @@ render( // Hot react component reloading. Unstable but helpful. if (module.hot) { module.hot.accept('./containers/App', () => { - // If you use Webpack 2 in ES modules mode, you can - // use here rather than require() a . - const NextApp = require('./containers/App').default render( - + , anchor ) diff --git a/source/webpack.config.js b/source/webpack.config.js index 5bdd3184a..1f5f3b7af 100644 --- a/source/webpack.config.js +++ b/source/webpack.config.js @@ -12,8 +12,8 @@ module.exports = { ] : [ 'webpack-dev-server/client?http://localhost:3000/', 'webpack/hot/only-dev-server', - 'react-hot-loader/patch', 'babel-polyfill', + 'react-hot-loader/patch', './source/entry.js' ], output: {