@cypress/webpack-dev-server 0.0.0-dev.87613

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.
Files changed (2) hide show
  1. package/README.md +82 -0
  2. package/package.json +70 -0
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # @cypress/webpack-dev-server
2
+
3
+ Implements the APIs for the object-syntax of the Cypress Component-testing "webpack dev server".
4
+
5
+ > **Note:** This package is bundled with the Cypress binary and should not need to be installed separately. See the [Component Framework Configuration Docs](https://docs.cypress.io/guides/component-testing/component-framework-configuration) for setting up component testing with webpack. The `devServer` function signature is for advanced use-cases.
6
+
7
+ Object API:
8
+
9
+ ```ts
10
+ import { defineConfig } from 'cypress'
11
+
12
+ export default defineConfig({
13
+ component: {
14
+ devServer: {
15
+ framework: 'react',
16
+ bundler: 'webpack',
17
+ // webpackConfig?: Will try to infer, if passed it will be used as is
18
+ }
19
+ }
20
+ })
21
+ ```
22
+
23
+ Function API:
24
+
25
+ ```ts
26
+ import { devServer } from '@cypress/webpack-dev-server'
27
+ import { defineConfig } from 'cypress'
28
+
29
+ export default defineConfig({
30
+ component: {
31
+ devServer(devServerConfig) {
32
+ return devServer({
33
+ ...devServerConfig,
34
+ framework: 'react',
35
+ webpackConfig: require('./webpack.config.js')
36
+ })
37
+ }
38
+ }
39
+ })
40
+ ```
41
+
42
+ ## Debugging
43
+
44
+ If having issues with chunk load errors or bundle size problems, specifically in your component tests, please try setting `DEBUG=cypress-verbose:webpack-dev-server:bundle-analyzer` before starting Cypress to get a `webpack-bundle-analyzer` report to help determine the cause of the issue. If filing an issue with Cypress, please include this report with your issue to better help us serve your issue.
45
+
46
+ ## Testing
47
+
48
+ Unit tests can be run with `yarn test`. Integration tests can be run with `yarn cypress:run`
49
+
50
+ This module should be primarily covered by system-tests / open-mode tests. All system-tests directories should be created using the notation:
51
+
52
+ `webpack${major}_wds${devServerMajor}-$framework{-$variant}`
53
+
54
+ - webpack4_wds4-react
55
+ - webpack5_wds5-react
56
+ - webpack4_wds4-next-11
57
+
58
+ ## Architecture
59
+
60
+ There should be a single publicly-exported entrypoint for the module, `devServer`, all other types and functions should be considered internal/implementation details, and types stripped from the output.
61
+
62
+ The `devServer` will first source the modules from the user's project, falling back to our own bundled versions of libraries. This ensures that the user has installed the current modules, and throws an error if the user does not have the library installed.
63
+
64
+ From there, we check the "framework" field to source or define any known webpack transforms to aid in the compilation.
65
+
66
+ We then merge the sourced config with the user's webpack config, and layer on our own transforms, and provide this to a webpack instance. The webpack instance used to create a webpack-dev-server, which is returned.
67
+
68
+ ## Compatibility
69
+
70
+ | @cypress/webpack-dev-server | cypress |
71
+ | ---------------------------- | -------------- |
72
+ | <= v1 | <= v9 |
73
+ | >= v2 <= v3 | >= v10 <= v13 |
74
+ | >= v4 | >= v14 |
75
+
76
+ ## License
77
+
78
+ [![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/develop/LICENSE)
79
+
80
+ This project is licensed under the terms of the [MIT license](/LICENSE).
81
+
82
+ ## [Changelog](./CHANGELOG.md)
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@cypress/webpack-dev-server",
3
+ "version": "0.0.0-dev.87613",
4
+ "description": "Launches Webpack Dev Server for Component Testing",
5
+ "homepage": "https://github.com/cypress-io/cypress/tree/develop/npm/webpack-dev-server#readme",
6
+ "bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/cypress-io/cypress.git"
10
+ },
11
+ "license": "MIT",
12
+ "main": "dist/index.js",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "scripts": {
17
+ "prebuild": "rimraf dist",
18
+ "build": "tsc || echo 'built, with type errors'",
19
+ "check-ts": "tsc --noEmit && tsc --project cypress/tsconfig.json",
20
+ "clean": "rimraf dist",
21
+ "cypress:open": "yarn cypress:run-cypress-in-cypress gulp open --project . --expose INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=true",
22
+ "cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress run --project . --browser chrome --expose INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=true",
23
+ "cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
24
+ "dev": "tsc --watch",
25
+ "lint": "eslint",
26
+ "test": "vitest run",
27
+ "test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0"
28
+ },
29
+ "lint-staged": {
30
+ "**/*.{js,jsx,ts,tsx,json}": "eslint --fix --no-warn-ignored"
31
+ },
32
+ "dependencies": {
33
+ "find-up": "6.3.0",
34
+ "fs-extra": "9.1.0",
35
+ "html-webpack-plugin-5": "npm:html-webpack-plugin@^5",
36
+ "local-pkg": "0.4.1",
37
+ "semver": "^7.7.3",
38
+ "tslib": "^2.3.1",
39
+ "tsx": "^4.23.12",
40
+ "webpack-bundle-analyzer": "4.10.2",
41
+ "webpack-dev-server": "^5.1.0",
42
+ "webpack-merge": "^5.4.0"
43
+ },
44
+ "devDependencies": {
45
+ "@packages/eslint-config": "0.0.0-development",
46
+ "@types/node": "24.10.1",
47
+ "@types/webpack-bundle-analyzer": "4.7.0",
48
+ "cross-env": "7.0.3",
49
+ "dedent": "^0.7.0",
50
+ "eslint": "^9.31.0",
51
+ "jiti": "^2.4.2",
52
+ "vitest": "^3.2.4",
53
+ "webpack": "npm:webpack@^5"
54
+ },
55
+ "peerDependencies": {
56
+ "cypress": ">=15.0.0"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
61
+ "nx": {
62
+ "targets": {
63
+ "build": {
64
+ "outputs": [
65
+ "{projectRoot}/dist"
66
+ ]
67
+ }
68
+ }
69
+ }
70
+ }