Skip to content

fixing 2 issues related to webpack-dev-server and HMR #939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/config-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,16 @@ class ConfigGenerator {
headers: { 'Access-Control-Allow-Origin': '*' },
compress: true,
historyApiFallback: true,
// In webpack-dev-server v4 beta 0, liveReload always causes
// the page to refresh, not allowing HMR to update the page.
// This is somehow related to the "static" option, but it's
// unknown if there is a better option.
// See https://github.com/webpack/webpack-dev-server/issues/2893
liveReload: false,
client: {
// see https://github.com/symfony/webpack-encore/issues/931#issuecomment-784483725
host: this.webpackConfig.runtimeConfig.devServerHost,
}
};

return applyOptionsCallback(
Expand Down
8 changes: 4 additions & 4 deletions test/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -2212,11 +2212,11 @@ module.exports = {
testSetup.runWebpack(config, (webpackAssert) => {
webpackAssert.assertDirectoryContents([
'entrypoints.json',
'runtime.fbc90386.js',
'main.06a6c20f.js',
'runtime.[hash:8].js',
'main.[hash:8].js',
'manifest.json',
'symfony_logo.91beba37.png',
'symfony_logo_alt.f880ba14.png',
'symfony_logo.[hash:8].png',
'symfony_logo_alt.[hash:8].png',
]);

webpackAssert.assertManifestPath(
Expand Down