Skip to content

Commit 0af7eeb

Browse files
committed
Removing section about HMR - it won't be supported originally
1 parent d2076ad commit 0af7eeb

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

README.rst

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -151,38 +151,37 @@ compile them as smaller files for ``production``:
151151

152152
.. code-block:: terminal
153153
154-
# in 'dev' environment, run this command to compile assets once
154+
# run this command to compile assets once (in dev mode)
155155
$ ./node_modules/.bin/encore dev
156-
# ... you can use '--watch' to recompile automatically if assets change
156+
157+
# use '--watch' to recompile automatically when files change
157158
$ ./node_modules/.bin/encore dev --watch
158159
159-
# in production servers, run this command to reduce the size of all files
160+
# when deploying, use "production" to optimize file size
160161
$ ./node_modules/.bin/encore production
161162
162163
.. note::
163164

164165
Restart ``encore`` each time you update your ``webpack.config.js`` file.
165166

166-
Hot Module Replacement (HRM) & webpack-dev-server
167-
-------------------------------------------------
168-
169-
`Hot Module Replacement`_ is a Webpack concept where "modules" can be automatically
170-
updated in the browser without needing to refresh the page!
167+
Using webpack-dev-server
168+
------------------------
171169

172-
To use it, execute ``encore`` with the ``dev-server`` command:
170+
You can also use the `webpack-dev-server`_ by running:
173171

174172
.. code-block:: terminal
175173
176-
./node_modules/.bin/encore dev-server --hot --inline
174+
./node_modules/.bin/encore dev-server
177175
178-
This serves the assets from a new server at ``http://localhost:8080``.
179-
If you've activated the :ref:`manifest.json versioning <load-manifest-files>`
180-
you're done! The paths in your templates will automatically point to the dev server.
176+
.. note::
177+
178+
Hot module replacement is currently not supported.
181179

182-
That's it! Now, modify a CSS file - you should see your browser
183-
update without needing to refresh! To use it with JavaScript, you'll
184-
need to do a bit more work. For example, see this article about
185-
using `HMR with React`_.
180+
This serves the assets from a new server at ``http://localhost:8080``
181+
(it does not actually write any files to disk). This means your
182+
``script`` and ``link`` tags need to change to point to this.
183+
If you've activated the :ref:`manifest.json versioning <load-manifest-files>`
184+
you're done: the paths in your templates will automatically point to the dev server.
186185

187186
Enabling Source Maps
188187
--------------------
@@ -642,7 +641,5 @@ no changes.
642641
.. _`linting`: https://stylelint.io/
643642
.. _`Babel`: http://babeljs.io/
644643
.. _`babel-react-preset`: https://babeljs.io/docs/plugins/preset-react/
645-
.. _`Hot Module Replacement`: https://webpack.js.org/concepts/hot-module-replacement/
646-
.. _`HMR with React`: https://webpack.js.org/guides/hmr-react/
647644
.. _`install Node.js`: https://nodejs.org/en/download/
648645
.. _`yarn package manager`: https://yarnpkg.com/lang/en/docs/install/

0 commit comments

Comments
 (0)