@cypress/webpack-dev-server 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@cypress/webpack-dev-server-v1.8.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.0...@cypress/webpack-dev-server-v1.8.1) (2022-02-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * detect newly added specs in dev-server compilation ([#17950](https://github.com/cypress-io/cypress/issues/17950)) ([f9ce67c](https://github.com/cypress-io/cypress/commit/f9ce67cfb6fed74a3549e7aff7ce0a5b217d9a13))
7
+
1
8
  # [@cypress/webpack-dev-server-v1.8.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.7.0...@cypress/webpack-dev-server-v1.8.0) (2021-12-16)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ function startDevServer(startDevServerArgs, exitProcess = process.exit) {
19
19
  const webpackDevServer = yield (0, startServer_1.start)(startDevServerArgs, exitProcess);
20
20
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
21
21
  if (webpackDevServerFacts_1.webpackDevServerFacts.isV3()) {
22
+ // @ts-ignore
22
23
  const server = webpackDevServer.listen(0, '127.0.0.1', () => {
23
24
  // FIXME: handle address returning a string
24
25
  const port = server.address().port;
package/dist/loader.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import { CypressCTWebpackContext } from './plugin';
2
- export default function loader(this: CypressCTWebpackContext): string;
2
+ import type { LoaderContext } from 'webpack';
3
+ export default function loader(this: CypressCTWebpackContext & LoaderContext<void>): string;
package/dist/loader.js CHANGED
@@ -67,6 +67,10 @@ function buildSpecs(projectRoot, files = []) {
67
67
  }
68
68
  // Runs the tests inside the iframe
69
69
  function loader() {
70
+ // In Webpack 5, a spec added after the dev-server is created won't
71
+ // be included in the compilation. Disabling the caching of this loader ensures
72
+ // we regenerate our specs and include any new ones in the compilation.
73
+ this.cacheable(false);
70
74
  const { files, projectRoot, supportFile } = this._cypress;
71
75
  const supportFileAbsolutePath = supportFile ? JSON.stringify(path.resolve(projectRoot, supportFile)) : undefined;
72
76
  return `
@@ -66,7 +66,7 @@ function start(_a, exitProcess = process.exit) {
66
66
  webpackDevServerConfig = Object.assign(Object.assign({ host: 'localhost', port: 'auto' }, userWebpackConfig === null || userWebpackConfig === void 0 ? void 0 : userWebpackConfig.devServer), { devMiddleware: {
67
67
  publicPath: devServerPublicPathRoute,
68
68
  }, hot: false });
69
- // @ts-expect-error Webpack types are clashing between Webpack and WebpackDevServer
69
+ // @ts-ignore Webpack types are clashing between Webpack and WebpackDevServer
70
70
  return new webpack_dev_server_1.default(webpackDevServerConfig, compiler);
71
71
  }
72
72
  throw webpackDevServerFacts_1.webpackDevServerFacts.unsupported();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cypress/webpack-dev-server",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Launches Webpack Dev Server for Component Testing",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
8
8
  "build-prod": "tsc",
9
- "test": "node ./test-wds-3.js",
9
+ "test": "node ./test-deps.js",
10
10
  "test-all": "tsc && mocha -r @packages/ts/register test/**/*.spec.ts test/*.spec.ts --exit",
11
11
  "watch": "tsc -w"
12
12
  },