@@ -151,38 +151,37 @@ compile them as smaller files for ``production``:
151
151
152
152
.. code-block :: terminal
153
153
154
- # in 'dev' environment, run this command to compile assets once
154
+ # run this command to compile assets once (in dev mode)
155
155
$ ./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
157
158
$ ./node_modules/.bin/encore dev --watch
158
159
159
- # in production servers, run this command to reduce the size of all files
160
+ # when deploying, use "production" to optimize file size
160
161
$ ./node_modules/.bin/encore production
161
162
162
163
.. note ::
163
164
164
165
Restart ``encore `` each time you update your ``webpack.config.js `` file.
165
166
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
+ ------------------------
171
169
172
- To use it, execute `` encore `` with the `` dev-server `` command :
170
+ You can also use the `webpack- dev-server `_ by running :
173
171
174
172
.. code-block :: terminal
175
173
176
- ./node_modules/.bin/encore dev-server --hot --inline
174
+ ./node_modules/.bin/encore dev-server
177
175
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 .
181
179
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.
186
185
187
186
Enabling Source Maps
188
187
--------------------
@@ -642,7 +641,5 @@ no changes.
642
641
.. _`linting` : https://stylelint.io/
643
642
.. _`Babel` : http://babeljs.io/
644
643
.. _`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/
647
644
.. _`install Node.js` : https://nodejs.org/en/download/
648
645
.. _`yarn package manager` : https://yarnpkg.com/lang/en/docs/install/
0 commit comments