Bump webpack-dev-server (#7988)

This commit is contained in:
Ian Schmitz
2019-11-24 14:18:33 -08:00
committed by GitHub
parent 5d24a5e88f
commit 82009f570d
8 changed files with 181 additions and 170 deletions

View File

@@ -66,6 +66,12 @@ module.exports = function(proxy, allowedHost) {
// in the Webpack development configuration. Note that only changes
// to CSS are currently hot reloaded. JS changes will refresh the browser.
hot: true,
// Use 'ws' instead of 'sockjs-node' on server since we're using native
// websockets in `webpackHotDevClient`.
transportMode: 'ws',
// Prevent a WS client from getting injected as we're already including
// `webpackHotDevClient`.
injectClient: false,
// It is important to tell WebpackDevServer to use the same "root" path
// as we specified in the config. In development, we always serve from /.
publicPath: '/',

View File

@@ -47,25 +47,36 @@ export default feature =>
let window;
if (process.env.E2E_FILE) {
window = (await JSDOM.fromFile(file, {
pretendToBeVisual: true,
resources: fileResourceLoader,
runScripts: 'dangerously',
url,
})).window;
window = (
await JSDOM.fromFile(file, {
pretendToBeVisual: true,
resources: fileResourceLoader,
runScripts: 'dangerously',
url,
})
).window;
} else {
window = (await JSDOM.fromURL(url, {
pretendToBeVisual: true,
resources: 'usable',
runScripts: 'dangerously',
})).window;
window = (
await JSDOM.fromURL(url, {
pretendToBeVisual: true,
resources: 'usable',
runScripts: 'dangerously',
})
).window;
}
const cleanup = () => {
if (window) {
window.close();
window = null;
}
};
const { document } = window;
const cancelToken = setTimeout(() => {
// Cleanup jsdom instance since we don't need it anymore
window.close();
cleanup();
reject(`Timed out loading feature: ${feature}`);
}, 10000);
@@ -81,7 +92,7 @@ export default feature =>
clearTimeout(cancelToken);
// Cleanup jsdom instance since we don't need it anymore
window.close();
cleanup();
reject(`Error loading feature: ${feature}`);
},

View File

@@ -77,7 +77,7 @@
"ts-pnp": "1.1.5",
"url-loader": "2.2.0",
"webpack": "4.41.2",
"webpack-dev-server": "3.2.1",
"webpack-dev-server": "3.9.0",
"webpack-manifest-plugin": "2.2.0",
"workbox-webpack-plugin": "4.3.1"
},