@cypress/webpack-dev-server 2.0.0 → 2.1.0
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/README.md +21 -8
- package/dist/CypressCTWebpackPlugin.js +3 -1
- package/dist/createWebpackDevServer.js +1 -1
- package/dist/devServer.d.ts +2 -2
- package/dist/devServer.js +6 -3
- package/dist/helpers/angularHandler.d.ts +80 -0
- package/dist/helpers/angularHandler.js +131 -0
- package/dist/helpers/createReactAppHandler.js +1 -0
- package/dist/helpers/nextHandler.d.ts +1 -0
- package/dist/helpers/nextHandler.js +53 -13
- package/dist/helpers/nuxtHandler.js +1 -0
- package/dist/helpers/sourceRelativeWebpackModules.js +17 -2
- package/dist/helpers/vueCliHandler.js +1 -0
- package/dist/makeDefaultWebpackConfig.js +3 -1
- package/dist/makeWebpackConfig.js +20 -1
- package/dist/measureWebpackPerformance.js +1 -0
- package/package.json +1 -1
- package/CHANGELOG.md +0 -225
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Implements the APIs for the object-syntax of the Cypress Component-testing "webpack dev server".
|
|
4
4
|
|
|
5
|
-
|
|
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:
|
|
6
8
|
|
|
7
9
|
```ts
|
|
8
10
|
import { defineConfig } from 'cypress'
|
|
@@ -18,7 +20,7 @@ export default defineConfig({
|
|
|
18
20
|
})
|
|
19
21
|
```
|
|
20
22
|
|
|
21
|
-
Function
|
|
23
|
+
Function API:
|
|
22
24
|
|
|
23
25
|
```ts
|
|
24
26
|
import { devServer } from '@cypress/webpack-dev-server'
|
|
@@ -26,10 +28,10 @@ import { defineConfig } from 'cypress'
|
|
|
26
28
|
|
|
27
29
|
export default defineConfig({
|
|
28
30
|
component: {
|
|
29
|
-
devServer(
|
|
31
|
+
devServer(devServerConfig) {
|
|
30
32
|
return devServer({
|
|
31
|
-
|
|
32
|
-
framework: 'react',
|
|
33
|
+
...devServerConfig,
|
|
34
|
+
framework: 'create-react-app',
|
|
33
35
|
webpackConfig: require('./webpack.config.js')
|
|
34
36
|
})
|
|
35
37
|
}
|
|
@@ -39,7 +41,7 @@ export default defineConfig({
|
|
|
39
41
|
|
|
40
42
|
## Testing
|
|
41
43
|
|
|
42
|
-
Unit tests can be run with `
|
|
44
|
+
Unit tests can be run with `yarn test`. Integration tests can be run with `yarn cypress:run`
|
|
43
45
|
|
|
44
46
|
This module should be primarily covered by system-tests / open-mode tests. All system-tests directories should be created using the notation:
|
|
45
47
|
|
|
@@ -60,6 +62,17 @@ From there, we check the "framework" field to source or define any known webpack
|
|
|
60
62
|
|
|
61
63
|
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.
|
|
62
64
|
|
|
63
|
-
##
|
|
65
|
+
## Compatibility
|
|
66
|
+
|
|
67
|
+
| @cypress/webpack-dev-server | cypress |
|
|
68
|
+
| --------------------------- | ------- |
|
|
69
|
+
| <= v1 | <= v9 |
|
|
70
|
+
| >= v2 | >= v10 |
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
[](https://github.com/cypress-io/cypress/blob/master/LICENSE)
|
|
75
|
+
|
|
76
|
+
This project is licensed under the terms of the [MIT license](/LICENSE).
|
|
64
77
|
|
|
65
|
-
[Changelog](./CHANGELOG.md)
|
|
78
|
+
## [Changelog](./CHANGELOG.md)
|
|
@@ -51,13 +51,15 @@ class CypressCTWebpackPlugin {
|
|
|
51
51
|
* has been "updated on disk", causing a recompliation (and pulling the new specs in as
|
|
52
52
|
* dependencies).
|
|
53
53
|
*/
|
|
54
|
-
this.onSpecsChange = (specs) => {
|
|
54
|
+
this.onSpecsChange = async (specs) => {
|
|
55
55
|
var _a;
|
|
56
56
|
if (!this.compilation || lodash_1.default.isEqual(specs, this.files)) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
this.files = specs;
|
|
60
60
|
const inputFileSystem = this.compilation.inputFileSystem;
|
|
61
|
+
// TODO: don't use a sync fs method here
|
|
62
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
61
63
|
const utimesSync = (_a = inputFileSystem.fileSystem.utimesSync) !== null && _a !== void 0 ? _a : fs_extra_1.default.utimesSync;
|
|
62
64
|
utimesSync(path_1.default.resolve(__dirname, 'browser.js'), new Date(), new Date());
|
|
63
65
|
};
|
|
@@ -14,7 +14,7 @@ async function createWebpackDevServer(config) {
|
|
|
14
14
|
return webpackDevServer4(config, webpackCompiler, finalWebpackConfig);
|
|
15
15
|
}
|
|
16
16
|
if (webpackDevServerMajorVersion === 3) {
|
|
17
|
-
debug('using webpack-dev-server
|
|
17
|
+
debug('using webpack-dev-server v3');
|
|
18
18
|
return webpackDevServer3(config, webpackCompiler, finalWebpackConfig);
|
|
19
19
|
}
|
|
20
20
|
throw new Error(`Unsupported webpackDevServer version ${webpackDevServerMajorVersion}`);
|
package/dist/devServer.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare type WebpackDevServerConfig = {
|
|
|
11
11
|
framework?: typeof ALL_FRAMEWORKS[number];
|
|
12
12
|
webpackConfig?: unknown;
|
|
13
13
|
};
|
|
14
|
-
declare const ALL_FRAMEWORKS: readonly ["create-react-app", "nuxt", "react", "vue-cli", "next", "vue"];
|
|
14
|
+
export declare const ALL_FRAMEWORKS: readonly ["create-react-app", "nuxt", "react", "vue-cli", "next", "vue"];
|
|
15
15
|
/**
|
|
16
16
|
* import { devServer } from '@cypress/webpack-dev-server'
|
|
17
17
|
*
|
|
@@ -29,7 +29,7 @@ export declare namespace devServer {
|
|
|
29
29
|
}>;
|
|
30
30
|
}
|
|
31
31
|
export declare type PresetHandlerResult = {
|
|
32
|
-
frameworkConfig
|
|
32
|
+
frameworkConfig: Configuration;
|
|
33
33
|
sourceWebpackModulesResult: SourceRelativeWebpackResult;
|
|
34
34
|
};
|
|
35
35
|
export default devServer;
|
package/dist/devServer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/// <reference types="cypress" />
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.devServer = void 0;
|
|
4
|
+
exports.devServer = exports.ALL_FRAMEWORKS = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const createWebpackDevServer_1 = require("./createWebpackDevServer");
|
|
7
7
|
const debug_1 = (0, tslib_1.__importDefault)(require("debug"));
|
|
@@ -11,7 +11,7 @@ const createReactAppHandler_1 = require("./helpers/createReactAppHandler");
|
|
|
11
11
|
const nextHandler_1 = require("./helpers/nextHandler");
|
|
12
12
|
const sourceRelativeWebpackModules_1 = require("./helpers/sourceRelativeWebpackModules");
|
|
13
13
|
const debug = (0, debug_1.default)('cypress:webpack-dev-server:devServer');
|
|
14
|
-
|
|
14
|
+
exports.ALL_FRAMEWORKS = ['create-react-app', 'nuxt', 'react', 'vue-cli', 'next', 'vue'];
|
|
15
15
|
/**
|
|
16
16
|
* import { devServer } from '@cypress/webpack-dev-server'
|
|
17
17
|
*
|
|
@@ -72,12 +72,15 @@ async function getPreset(devServerConfig) {
|
|
|
72
72
|
return (0, vueCliHandler_1.vueCliHandler)(devServerConfig);
|
|
73
73
|
case 'next':
|
|
74
74
|
return await (0, nextHandler_1.nextHandler)(devServerConfig);
|
|
75
|
+
// TODO: revert once Angular is slated for release
|
|
76
|
+
// case 'angular':
|
|
77
|
+
// return await angularHandler(devServerConfig)
|
|
75
78
|
case 'react':
|
|
76
79
|
case 'vue':
|
|
77
80
|
case undefined:
|
|
78
81
|
return { sourceWebpackModulesResult: (0, sourceRelativeWebpackModules_1.sourceDefaultWebpackDependencies)(devServerConfig) };
|
|
79
82
|
default:
|
|
80
|
-
throw new Error(`Unexpected framework ${devServerConfig.framework}, expected one of ${ALL_FRAMEWORKS.join(', ')}`);
|
|
83
|
+
throw new Error(`Unexpected framework ${devServerConfig.framework}, expected one of ${exports.ALL_FRAMEWORKS.join(', ')}`);
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
/**
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { PresetHandlerResult, WebpackDevServerConfig } from '../devServer';
|
|
2
|
+
export declare type AngularJsonProjectConfig = {
|
|
3
|
+
projectType: string;
|
|
4
|
+
root: string;
|
|
5
|
+
sourceRoot: string;
|
|
6
|
+
architect: {
|
|
7
|
+
build: {
|
|
8
|
+
options: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
} & {
|
|
11
|
+
polyfills?: string;
|
|
12
|
+
};
|
|
13
|
+
configurations?: {
|
|
14
|
+
[configuration: string]: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
declare type AngularJson = {
|
|
22
|
+
defaultProject?: string;
|
|
23
|
+
projects: {
|
|
24
|
+
[project: string]: AngularJsonProjectConfig;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare function angularHandler(devServerConfig: WebpackDevServerConfig): Promise<PresetHandlerResult>;
|
|
28
|
+
export declare function getAngularBuildOptions(projectConfig: AngularJsonProjectConfig, tsConfig: string): {
|
|
29
|
+
tsConfig: string;
|
|
30
|
+
aot: boolean;
|
|
31
|
+
outputHashing: string;
|
|
32
|
+
budgets: undefined;
|
|
33
|
+
polyfills?: string | undefined;
|
|
34
|
+
outputPath: string;
|
|
35
|
+
assets: never[];
|
|
36
|
+
styles: never[];
|
|
37
|
+
scripts: never[];
|
|
38
|
+
fileReplacements: never[];
|
|
39
|
+
inlineStyleLanguage: string;
|
|
40
|
+
stylePreprocessorOptions: {
|
|
41
|
+
includePaths: never[];
|
|
42
|
+
};
|
|
43
|
+
resourcesOutputPath: undefined;
|
|
44
|
+
commonChunk: boolean;
|
|
45
|
+
baseHref: undefined;
|
|
46
|
+
deployUrl: undefined;
|
|
47
|
+
verbose: boolean;
|
|
48
|
+
progress: boolean;
|
|
49
|
+
i18nMissingTranslation: string;
|
|
50
|
+
i18nDuplicateTranslation: string;
|
|
51
|
+
localize: undefined;
|
|
52
|
+
watch: boolean;
|
|
53
|
+
poll: undefined;
|
|
54
|
+
deleteOutputPath: boolean;
|
|
55
|
+
preserveSymlinks: undefined;
|
|
56
|
+
showCircularDependencies: boolean;
|
|
57
|
+
subresourceIntegrity: boolean;
|
|
58
|
+
serviceWorker: boolean;
|
|
59
|
+
ngswConfigPath: undefined;
|
|
60
|
+
statsJson: boolean;
|
|
61
|
+
webWorkerTsConfig: undefined;
|
|
62
|
+
crossOrigin: string;
|
|
63
|
+
allowedCommonJsDependencies: never[];
|
|
64
|
+
buildOptimizer: boolean;
|
|
65
|
+
optimization: boolean;
|
|
66
|
+
vendorChunk: boolean;
|
|
67
|
+
extractLicenses: boolean;
|
|
68
|
+
sourceMap: boolean;
|
|
69
|
+
namedChunks: boolean;
|
|
70
|
+
};
|
|
71
|
+
export declare function generateTsConfig(devServerConfig: WebpackDevServerConfig, projectConfig: AngularJsonProjectConfig): Promise<string>;
|
|
72
|
+
export declare function getTempDir(): Promise<string>;
|
|
73
|
+
export declare function getAngularCliModules(projectRoot: string): Promise<{
|
|
74
|
+
generateBrowserWebpackConfigFromContext: any;
|
|
75
|
+
getCommonConfig: any;
|
|
76
|
+
getStylesConfig: any;
|
|
77
|
+
}>;
|
|
78
|
+
export declare function getAngularJson(projectRoot: string): Promise<AngularJson>;
|
|
79
|
+
export declare const toPosix: (filePath: string) => string;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toPosix = exports.getAngularJson = exports.getAngularCliModules = exports.getTempDir = exports.generateTsConfig = exports.getAngularBuildOptions = exports.angularHandler = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = (0, tslib_1.__importStar)(require("fs-extra"));
|
|
6
|
+
const os_1 = require("os");
|
|
7
|
+
const path = (0, tslib_1.__importStar)(require("path"));
|
|
8
|
+
const url_1 = require("url");
|
|
9
|
+
const sourceRelativeWebpackModules_1 = require("./sourceRelativeWebpackModules");
|
|
10
|
+
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
11
|
+
async function angularHandler(devServerConfig) {
|
|
12
|
+
const webpackConfig = await getAngularCliWebpackConfig(devServerConfig);
|
|
13
|
+
return { frameworkConfig: webpackConfig, sourceWebpackModulesResult: (0, sourceRelativeWebpackModules_1.sourceDefaultWebpackDependencies)(devServerConfig) };
|
|
14
|
+
}
|
|
15
|
+
exports.angularHandler = angularHandler;
|
|
16
|
+
async function getAngularCliWebpackConfig(devServerConfig) {
|
|
17
|
+
const { projectRoot } = devServerConfig.cypressConfig;
|
|
18
|
+
const { generateBrowserWebpackConfigFromContext, getCommonConfig, getStylesConfig, } = await getAngularCliModules(projectRoot);
|
|
19
|
+
const angularJson = await getAngularJson(projectRoot);
|
|
20
|
+
let { defaultProject } = angularJson;
|
|
21
|
+
if (!defaultProject) {
|
|
22
|
+
defaultProject = Object.keys(angularJson.projects).find((name) => angularJson.projects[name].projectType === 'application');
|
|
23
|
+
if (!defaultProject) {
|
|
24
|
+
throw new Error('Could not find a project with projectType "application" in "angular.json"');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const defaultProjectConfig = angularJson.projects[defaultProject];
|
|
28
|
+
const tsConfig = await generateTsConfig(devServerConfig, defaultProjectConfig);
|
|
29
|
+
const buildOptions = getAngularBuildOptions(defaultProjectConfig, tsConfig);
|
|
30
|
+
const context = createFakeContext(projectRoot, defaultProject, defaultProjectConfig);
|
|
31
|
+
const { config } = await generateBrowserWebpackConfigFromContext(buildOptions, context, (wco) => [getCommonConfig(wco), getStylesConfig(wco)]);
|
|
32
|
+
delete config.entry.main;
|
|
33
|
+
return config;
|
|
34
|
+
}
|
|
35
|
+
function getAngularBuildOptions(projectConfig, tsConfig) {
|
|
36
|
+
var _a;
|
|
37
|
+
// Default options are derived from the @angular-devkit/build-angular browser builder, with some options from
|
|
38
|
+
// the serve builder thrown in for development.
|
|
39
|
+
// see: https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/src/builders/browser/schema.json
|
|
40
|
+
return Object.assign(Object.assign(Object.assign({ outputPath: 'dist/angular-app', assets: [], styles: [], scripts: [], fileReplacements: [], inlineStyleLanguage: 'css', stylePreprocessorOptions: { includePaths: [] }, resourcesOutputPath: undefined, commonChunk: true, baseHref: undefined, deployUrl: undefined, verbose: false, progress: false, i18nMissingTranslation: 'warning', i18nDuplicateTranslation: 'warning', localize: undefined, watch: true, poll: undefined, deleteOutputPath: true, preserveSymlinks: undefined, showCircularDependencies: false, subresourceIntegrity: false, serviceWorker: false, ngswConfigPath: undefined, statsJson: false, webWorkerTsConfig: undefined, crossOrigin: 'none', allowedCommonJsDependencies: [], buildOptimizer: false, optimization: false, vendorChunk: true, extractLicenses: false, sourceMap: true, namedChunks: true }, projectConfig.architect.build.options), ((_a = projectConfig.architect.build.configurations) === null || _a === void 0 ? void 0 : _a.development) || {}), { tsConfig, aot: false, outputHashing: 'none', budgets: undefined });
|
|
41
|
+
}
|
|
42
|
+
exports.getAngularBuildOptions = getAngularBuildOptions;
|
|
43
|
+
async function generateTsConfig(devServerConfig, projectConfig) {
|
|
44
|
+
const { cypressConfig } = devServerConfig;
|
|
45
|
+
const { projectRoot } = cypressConfig;
|
|
46
|
+
const specPattern = Array.isArray(cypressConfig.specPattern) ? cypressConfig.specPattern : [cypressConfig.specPattern];
|
|
47
|
+
const getProjectFilePath = (...fileParts) => (0, exports.toPosix)(path.join(projectRoot, ...fileParts));
|
|
48
|
+
const includePaths = [...specPattern.map((pattern) => getProjectFilePath(pattern))];
|
|
49
|
+
if (cypressConfig.supportFile) {
|
|
50
|
+
includePaths.push((0, exports.toPosix)(cypressConfig.supportFile));
|
|
51
|
+
}
|
|
52
|
+
if (projectConfig.architect.build.options.polyfills) {
|
|
53
|
+
const polyfills = getProjectFilePath(projectConfig.architect.build.options.polyfills);
|
|
54
|
+
includePaths.push(polyfills);
|
|
55
|
+
}
|
|
56
|
+
const cypressTypes = getProjectFilePath('node_modules', 'cypress', 'types', 'index.d.ts');
|
|
57
|
+
includePaths.push(cypressTypes);
|
|
58
|
+
const tsConfigContent = JSON.stringify({
|
|
59
|
+
extends: getProjectFilePath('tsconfig.json'),
|
|
60
|
+
compilerOptions: {
|
|
61
|
+
outDir: getProjectFilePath('out-tsc/cy'),
|
|
62
|
+
allowSyntheticDefaultImports: true,
|
|
63
|
+
skipLibCheck: true,
|
|
64
|
+
},
|
|
65
|
+
include: includePaths,
|
|
66
|
+
});
|
|
67
|
+
const tsConfigPath = path.join(await getTempDir(), 'tsconfig.json');
|
|
68
|
+
await fs.writeFile(tsConfigPath, tsConfigContent);
|
|
69
|
+
return tsConfigPath;
|
|
70
|
+
}
|
|
71
|
+
exports.generateTsConfig = generateTsConfig;
|
|
72
|
+
async function getTempDir() {
|
|
73
|
+
const cypressTempDir = path.join((0, os_1.tmpdir)(), 'cypress-angular-ct');
|
|
74
|
+
await fs.ensureDir(cypressTempDir);
|
|
75
|
+
return cypressTempDir;
|
|
76
|
+
}
|
|
77
|
+
exports.getTempDir = getTempDir;
|
|
78
|
+
async function getAngularCliModules(projectRoot) {
|
|
79
|
+
const [{ generateBrowserWebpackConfigFromContext }, { getCommonConfig }, { getStylesConfig },] = await Promise.all([
|
|
80
|
+
'@angular-devkit/build-angular/src/utils/webpack-browser-config.js',
|
|
81
|
+
'@angular-devkit/build-angular/src/webpack/configs/common.js',
|
|
82
|
+
'@angular-devkit/build-angular/src/webpack/configs/styles.js',
|
|
83
|
+
].map((dep) => {
|
|
84
|
+
try {
|
|
85
|
+
const depPath = require.resolve(dep, { paths: [projectRoot] });
|
|
86
|
+
const url = (0, url_1.pathToFileURL)(depPath).href;
|
|
87
|
+
return dynamicImport(url);
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
throw new Error(`Could not resolve "${dep}". Do you have "@angular-devkit/build-angular" installed?`);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
return {
|
|
94
|
+
generateBrowserWebpackConfigFromContext,
|
|
95
|
+
getCommonConfig,
|
|
96
|
+
getStylesConfig,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
exports.getAngularCliModules = getAngularCliModules;
|
|
100
|
+
async function getAngularJson(projectRoot) {
|
|
101
|
+
const { findUp } = await dynamicImport('find-up');
|
|
102
|
+
const angularJsonPath = await findUp('angular.json', { cwd: projectRoot });
|
|
103
|
+
if (!angularJsonPath) {
|
|
104
|
+
throw new Error(`Could not find angular.json. Looked in ${projectRoot} and up.`);
|
|
105
|
+
}
|
|
106
|
+
const angularJson = await fs.readFile(angularJsonPath, 'utf8');
|
|
107
|
+
return JSON.parse(angularJson);
|
|
108
|
+
}
|
|
109
|
+
exports.getAngularJson = getAngularJson;
|
|
110
|
+
function createFakeContext(projectRoot, defaultProject, defaultProjectConfig) {
|
|
111
|
+
const logger = {
|
|
112
|
+
createChild: () => ({}),
|
|
113
|
+
};
|
|
114
|
+
const context = {
|
|
115
|
+
target: {
|
|
116
|
+
project: defaultProject,
|
|
117
|
+
},
|
|
118
|
+
workspaceRoot: projectRoot,
|
|
119
|
+
getProjectMetadata: () => {
|
|
120
|
+
return {
|
|
121
|
+
root: defaultProjectConfig.root,
|
|
122
|
+
sourceRoot: defaultProjectConfig.root,
|
|
123
|
+
projectType: 'application',
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
logger,
|
|
127
|
+
};
|
|
128
|
+
return context;
|
|
129
|
+
}
|
|
130
|
+
const toPosix = (filePath) => filePath.split(path.sep).join(path.posix.sep);
|
|
131
|
+
exports.toPosix = toPosix;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nextHandler = void 0;
|
|
3
|
+
exports.allCssTests = exports.nextHandler = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const debug_1 = (0, tslib_1.__importDefault)(require("debug"));
|
|
6
6
|
const module_1 = (0, tslib_1.__importDefault)(require("module"));
|
|
@@ -12,12 +12,9 @@ async function nextHandler(devServerConfig) {
|
|
|
12
12
|
const webpackConfig = await loadWebpackConfig(devServerConfig);
|
|
13
13
|
debug('resolved next.js webpack config %o', webpackConfig);
|
|
14
14
|
checkSWC(webpackConfig, devServerConfig.cypressConfig);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
webpackConfig.watchOptions = Object.assign(Object.assign({}, webpackConfig.watchOptions), { ignored: [...webpackConfig.watchOptions.ignored.filter((pattern) => !/node_modules/.test(pattern)), '**/node_modules/!(@cypress/webpack-dev-server/dist/browser.js)**'] });
|
|
19
|
-
debug('found options next.js watchOptions.ignored %O', webpackConfig.watchOptions.ignored);
|
|
20
|
-
}
|
|
15
|
+
watchEntryPoint(webpackConfig);
|
|
16
|
+
allowGlobalStylesImports(webpackConfig);
|
|
17
|
+
changeNextCachePath(webpackConfig);
|
|
21
18
|
return { frameworkConfig: webpackConfig, sourceWebpackModulesResult: sourceNextWebpackDeps(devServerConfig) };
|
|
22
19
|
}
|
|
23
20
|
exports.nextHandler = nextHandler;
|
|
@@ -51,11 +48,12 @@ async function loadWebpackConfig(devServerConfig) {
|
|
|
51
48
|
const { loadConfig, getNextJsBaseWebpackConfig } = getNextJsPackages(devServerConfig);
|
|
52
49
|
const nextConfig = await loadConfig('development', devServerConfig.cypressConfig.projectRoot);
|
|
53
50
|
const runWebpackSpan = getRunWebpackSpan(devServerConfig);
|
|
54
|
-
const webpackConfig = await getNextJsBaseWebpackConfig(devServerConfig.cypressConfig.projectRoot, Object.assign(Object.assign({ buildId: `@cypress/react-${Math.random().toString()}`, config: nextConfig, dev: true, pagesDir: findPagesDir(devServerConfig.cypressConfig.projectRoot), entrypoints: {}, rewrites: { fallback: [], afterFiles: [], beforeFiles: [] } }, runWebpackSpan), {
|
|
51
|
+
const webpackConfig = await getNextJsBaseWebpackConfig(devServerConfig.cypressConfig.projectRoot, Object.assign(Object.assign({ buildId: `@cypress/react-${Math.random().toString()}`, config: nextConfig, dev: true, pagesDir: await findPagesDir(devServerConfig.cypressConfig.projectRoot), entrypoints: {}, rewrites: { fallback: [], afterFiles: [], beforeFiles: [] } }, runWebpackSpan), {
|
|
55
52
|
// Client webpack config for Next.js <= 12.1.5
|
|
56
53
|
isServer: false,
|
|
57
54
|
// Client webpack config for Next.js > 12.1.5
|
|
58
55
|
compilerType: 'client' }));
|
|
56
|
+
delete webpackConfig.entry;
|
|
59
57
|
return webpackConfig;
|
|
60
58
|
}
|
|
61
59
|
/**
|
|
@@ -75,9 +73,9 @@ function checkSWC(webpackConfig, cypressConfig) {
|
|
|
75
73
|
}
|
|
76
74
|
return false;
|
|
77
75
|
}
|
|
78
|
-
const
|
|
76
|
+
const exists = async (file) => {
|
|
79
77
|
try {
|
|
80
|
-
fs.
|
|
78
|
+
await fs.promises.access(file, fs.constants.F_OK);
|
|
81
79
|
return true;
|
|
82
80
|
}
|
|
83
81
|
catch (_) {
|
|
@@ -89,14 +87,14 @@ const existsSync = (file) => {
|
|
|
89
87
|
* `${projectRoot}/pages` or `${projectRoot}/src/pages`.
|
|
90
88
|
* If neither is found, return projectRoot
|
|
91
89
|
*/
|
|
92
|
-
function findPagesDir(projectRoot) {
|
|
90
|
+
async function findPagesDir(projectRoot) {
|
|
93
91
|
// prioritize ./pages over ./src/pages
|
|
94
92
|
let pagesDir = path.join(projectRoot, 'pages');
|
|
95
|
-
if (
|
|
93
|
+
if (await exists(pagesDir)) {
|
|
96
94
|
return pagesDir;
|
|
97
95
|
}
|
|
98
96
|
pagesDir = path.join(projectRoot, 'src', 'pages');
|
|
99
|
-
if (
|
|
97
|
+
if (await exists(pagesDir)) {
|
|
100
98
|
return pagesDir;
|
|
101
99
|
}
|
|
102
100
|
return projectRoot;
|
|
@@ -195,3 +193,45 @@ function sourceNextWebpack(devServerConfig, framework) {
|
|
|
195
193
|
};
|
|
196
194
|
return webpack;
|
|
197
195
|
}
|
|
196
|
+
// Next webpack compiler ignored watching any node_modules changes, but we need to watch
|
|
197
|
+
// for changes to 'dist/browser.js' in order to detect new specs that have been added
|
|
198
|
+
function watchEntryPoint(webpackConfig) {
|
|
199
|
+
if (webpackConfig.watchOptions && Array.isArray(webpackConfig.watchOptions.ignored)) {
|
|
200
|
+
webpackConfig.watchOptions = Object.assign(Object.assign({}, webpackConfig.watchOptions), { ignored: [...webpackConfig.watchOptions.ignored.filter((pattern) => !/node_modules/.test(pattern)), '**/node_modules/!(@cypress/webpack-dev-server/dist/browser.js)**'] });
|
|
201
|
+
debug('found options next.js watchOptions.ignored %O', webpackConfig.watchOptions.ignored);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// We are matching the Next.js regex rules exactly. If we were writing our own loader, we could
|
|
205
|
+
// condense these regex rules into a single rule but we need the regex.source to be identical to what
|
|
206
|
+
// we get from Next.js webpack config
|
|
207
|
+
// see: https://github.com/vercel/next.js/blob/20486c159d8538a337da6b07b0b4490a3a0d6b91/packages/next/build/webpack/config/blocks/css/index.ts#L18
|
|
208
|
+
const globalCssRe = [/(?<!\.module)\.css$/, /(?<!\.module)\.(scss|sass)$/];
|
|
209
|
+
const globalCssModulesRe = [/\.module\.css$/, /\.module\.(scss|sass)$/];
|
|
210
|
+
exports.allCssTests = [...globalCssRe, ...globalCssModulesRe];
|
|
211
|
+
// Next does not allow global styles to be loaded outside of the main <App /> component.
|
|
212
|
+
// We want users to be able to import the global styles into their component support file so we
|
|
213
|
+
// delete the "issuer" from the rules that process css/scss files.
|
|
214
|
+
// see: https://github.com/cypress-io/cypress/issues/22525
|
|
215
|
+
// Motivated by: https://github.com/bem/next-global-css
|
|
216
|
+
function allowGlobalStylesImports(webpackConfig) {
|
|
217
|
+
var _a;
|
|
218
|
+
const rules = ((_a = webpackConfig.module) === null || _a === void 0 ? void 0 : _a.rules) || [];
|
|
219
|
+
for (const rule of rules) {
|
|
220
|
+
if (typeof rule !== 'string' && rule.oneOf) {
|
|
221
|
+
for (const oneOf of rule.oneOf) {
|
|
222
|
+
if (oneOf.test && exports.allCssTests.some((re) => { var _a; return re.source === ((_a = oneOf.test) === null || _a === void 0 ? void 0 : _a.source); })) {
|
|
223
|
+
delete oneOf.issuer;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Our modifications of the Next webpack config can corrupt the cache used for local development.
|
|
230
|
+
// We separate the cache used for CT from the normal cache (".next/cache/webpack" -> ".next/cache/cypress-webpack") so they don't interfere with each other
|
|
231
|
+
function changeNextCachePath(webpackConfig) {
|
|
232
|
+
if (typeof webpackConfig.cache === 'object' && ('cacheDirectory' in webpackConfig.cache) && webpackConfig.cache.cacheDirectory) {
|
|
233
|
+
const { cacheDirectory } = webpackConfig.cache;
|
|
234
|
+
webpackConfig.cache.cacheDirectory = cacheDirectory.replace(/webpack$/, 'cypress-webpack');
|
|
235
|
+
debug('Changing Next cache path from %s to %s', cacheDirectory, webpackConfig.cache.cacheDirectory);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -16,6 +16,7 @@ async function nuxtHandler(devServerConfig) {
|
|
|
16
16
|
// Nuxt has asset size warnings configured by default which will cause webpack overlays to appear
|
|
17
17
|
// in the browser which we don't want.
|
|
18
18
|
delete webpackConfig.performance;
|
|
19
|
+
delete webpackConfig.entry;
|
|
19
20
|
debug('webpack config %o', webpackConfig);
|
|
20
21
|
return { frameworkConfig: webpackConfig, sourceWebpackModulesResult };
|
|
21
22
|
}
|
|
@@ -16,7 +16,17 @@ const cypressWebpackPath = (config) => {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
exports.cypressWebpackPath = cypressWebpackPath;
|
|
19
|
-
|
|
19
|
+
const frameworkWebpackMapper = {
|
|
20
|
+
'create-react-app': 'react-scripts',
|
|
21
|
+
'vue-cli': '@vue/cli-service',
|
|
22
|
+
'nuxt': '@nuxt/webpack',
|
|
23
|
+
react: undefined,
|
|
24
|
+
vue: undefined,
|
|
25
|
+
next: 'next',
|
|
26
|
+
// TODO: revert once Angular is slated for release
|
|
27
|
+
// 'angular': '@angular-devkit/build-angular',
|
|
28
|
+
};
|
|
29
|
+
// Source the users framework from the provided projectRoot. The framework, if available, will serve
|
|
20
30
|
// as the resolve base for webpack dependency resolution.
|
|
21
31
|
function sourceFramework(config) {
|
|
22
32
|
debug('Framework: Attempting to source framework for %s', config.cypressConfig.projectRoot);
|
|
@@ -24,9 +34,14 @@ function sourceFramework(config) {
|
|
|
24
34
|
debug('Framework: No framework provided');
|
|
25
35
|
return null;
|
|
26
36
|
}
|
|
37
|
+
const sourceOfWebpack = frameworkWebpackMapper[config.framework];
|
|
38
|
+
if (!sourceOfWebpack) {
|
|
39
|
+
debug('Not a higher-order framework so webpack dependencies should be resolvable from projectRoot');
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
27
42
|
const framework = {};
|
|
28
43
|
try {
|
|
29
|
-
const frameworkJsonPath = require.resolve(`${
|
|
44
|
+
const frameworkJsonPath = require.resolve(`${sourceOfWebpack}/package.json`, {
|
|
30
45
|
paths: [config.cypressConfig.projectRoot],
|
|
31
46
|
});
|
|
32
47
|
const frameworkPathRoot = path_1.default.dirname(frameworkJsonPath);
|
|
@@ -28,8 +28,10 @@ function makeDefaultWebpackConfig(config) {
|
|
|
28
28
|
},
|
|
29
29
|
plugins: [
|
|
30
30
|
new HtmlWebpackPlugin({
|
|
31
|
-
// Todo: Add indexHtmlFile when it gets added as a config property
|
|
32
31
|
template: indexHtmlFile,
|
|
32
|
+
// TODO: revert once Angular is slated for release
|
|
33
|
+
// Angular generates all of it's scripts with <script type="module">. Live-reloading breaks without this option.
|
|
34
|
+
// ...(config.devServerConfig.framework === 'angular' ? { scriptLoading: 'module' } : {}),
|
|
33
35
|
}),
|
|
34
36
|
],
|
|
35
37
|
};
|
|
@@ -60,6 +60,25 @@ function modifyWebpackConfigForCypress(webpackConfig) {
|
|
|
60
60
|
}
|
|
61
61
|
return webpackConfig;
|
|
62
62
|
}
|
|
63
|
+
async function addEntryPoint(webpackConfig) {
|
|
64
|
+
let entry = webpackConfig.entry;
|
|
65
|
+
if (typeof entry === 'function') {
|
|
66
|
+
entry = await entry();
|
|
67
|
+
}
|
|
68
|
+
if (typeof entry === 'string') {
|
|
69
|
+
entry = [entry, CYPRESS_WEBPACK_ENTRYPOINT];
|
|
70
|
+
}
|
|
71
|
+
else if (Array.isArray(entry)) {
|
|
72
|
+
entry.push(CYPRESS_WEBPACK_ENTRYPOINT);
|
|
73
|
+
}
|
|
74
|
+
else if (typeof entry === 'object') {
|
|
75
|
+
entry = Object.assign(Object.assign({}, entry), { ['cypress-entry']: CYPRESS_WEBPACK_ENTRYPOINT });
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
entry = CYPRESS_WEBPACK_ENTRYPOINT;
|
|
79
|
+
}
|
|
80
|
+
webpackConfig.entry = entry;
|
|
81
|
+
}
|
|
63
82
|
/**
|
|
64
83
|
* Creates a webpack 4/5 compatible webpack "configuration"
|
|
65
84
|
* to pass to the sourced webpack function
|
|
@@ -122,7 +141,7 @@ async function makeWebpackConfig(config) {
|
|
|
122
141
|
],
|
|
123
142
|
};
|
|
124
143
|
const mergedConfig = (0, webpack_merge_1.merge)(userAndFrameworkWebpackConfig, (0, makeDefaultWebpackConfig_1.makeDefaultWebpackConfig)(config), dynamicWebpackConfig);
|
|
125
|
-
mergedConfig
|
|
144
|
+
await addEntryPoint(mergedConfig);
|
|
126
145
|
debug('Merged webpack config %o', mergedConfig);
|
|
127
146
|
if (process.env.WEBPACK_PERF_MEASURE) {
|
|
128
147
|
// only for debugging
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.measureWebpackPerformance = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable no-restricted-syntax */
|
|
5
6
|
/* eslint-disable no-console */
|
|
6
7
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
7
8
|
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
# [@cypress/webpack-dev-server-v2.0.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.4...@cypress/webpack-dev-server-v2.0.0) (2022-06-13)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* add package.json metadata for webpack-dev-server ([#22292](https://github.com/cypress-io/cypress/issues/22292)) ([9cfec97](https://github.com/cypress-io/cypress/commit/9cfec9750f2ddc9fe691aabbe2ecc9bc02a3d915))
|
|
7
|
-
* ct testing support for node 17+ ([#21430](https://github.com/cypress-io/cypress/issues/21430)) ([0f786ab](https://github.com/cypress-io/cypress/commit/0f786ab893d178c2f87eed6a1334a248c6bec7a6))
|
|
8
|
-
* display cy.mount command log ([#21500](https://github.com/cypress-io/cypress/issues/21500)) ([140b4ba](https://github.com/cypress-io/cypress/commit/140b4ba2110243712a614a39b2408c30cce4d0b1))
|
|
9
|
-
* Ensuring spec file presence prior to webpack-dev-server compilation ([#21550](https://github.com/cypress-io/cypress/issues/21550)) ([87eec2b](https://github.com/cypress-io/cypress/commit/87eec2b460b02a123667b40ee907878fa4be2bee))
|
|
10
|
-
* Guard against slow requests in GraphQL Resolution (part 2) ([#21020](https://github.com/cypress-io/cypress/issues/21020)) ([b0c8db3](https://github.com/cypress-io/cypress/commit/b0c8db34348be31f32795f3f67c3408403d59ace))
|
|
11
|
-
* issue with compilation failures in component testing ([#21599](https://github.com/cypress-io/cypress/issues/21599)) ([f2bce02](https://github.com/cypress-io/cypress/commit/f2bce02f5dcab7a73a2a1b8e102518d706a29c25))
|
|
12
|
-
* next 12.1.6 support and add tests ([#21515](https://github.com/cypress-io/cypress/issues/21515)) ([ada7179](https://github.com/cypress-io/cypress/commit/ada7179acb4ff0ca0057714883153cc9b2006daa))
|
|
13
|
-
* restart dev-server on config change ([#21212](https://github.com/cypress-io/cypress/issues/21212)) ([00a0f5a](https://github.com/cypress-io/cypress/commit/00a0f5a0e905fdfe5ef9f8ba71f915ed20ca4b72))
|
|
14
|
-
* supportFile path and supportFile false for vite on windows ([#21156](https://github.com/cypress-io/cypress/issues/21156)) ([dd180c8](https://github.com/cypress-io/cypress/commit/dd180c89b27546b0c96cc3f4fb4e75d983c8003e))
|
|
15
|
-
* UNIFY-1774 error if component config is not sourced for webpack/vite ([#21563](https://github.com/cypress-io/cypress/issues/21563)) ([566a7b1](https://github.com/cypress-io/cypress/commit/566a7b1feb0fc1a8f1ccf83a23d8ad7a94409a6b))
|
|
16
|
-
* wire up scaffolded indexHtml to dev servers ([#20453](https://github.com/cypress-io/cypress/issues/20453)) ([3a8797e](https://github.com/cypress-io/cypress/commit/3a8797e54db9fd0ef93a14ddc71c138ba8251e53))
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### chore
|
|
20
|
-
|
|
21
|
-
* prep npm packages for use with Cypress v10 ([b924d08](https://github.com/cypress-io/cypress/commit/b924d086ee2e2ccc93303731e001b2c9e9d0af17))
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### Features
|
|
25
|
-
|
|
26
|
-
* add new webpack-dev-server package based on object API & bundling ([#20861](https://github.com/cypress-io/cypress/issues/20861)) ([e1da852](https://github.com/cypress-io/cypress/commit/e1da8524733c0ebedc2aed5c97117adb25fa733b))
|
|
27
|
-
* Add typings for new devServer config ([#18797](https://github.com/cypress-io/cypress/issues/18797)) ([e018a14](https://github.com/cypress-io/cypress/commit/e018a14c211bfcbdc4568a9a737f14f5c1686e35))
|
|
28
|
-
* Deprecate run-ct / open-ct, and update all examples to use --ct instead ([#18422](https://github.com/cypress-io/cypress/issues/18422)) ([196e8f6](https://github.com/cypress-io/cypress/commit/196e8f62cc6d27974f235945cb5700624b3dae41))
|
|
29
|
-
* index.html configurability and storybook support ([#18242](https://github.com/cypress-io/cypress/issues/18242)) ([745b3ac](https://github.com/cypress-io/cypress/commit/745b3ac4518302983522daedf817623334feae5b))
|
|
30
|
-
* merging / delegating remote queries to cloud schema ([#17875](https://github.com/cypress-io/cypress/issues/17875)) ([94541d4](https://github.com/cypress-io/cypress/commit/94541d4f18591e8fa4b8702c39e92b0a7238aa5d))
|
|
31
|
-
* swap the #__cy_root id selector to become data-cy-root for component mounting ([#20951](https://github.com/cypress-io/cypress/issues/20951)) ([0e7b555](https://github.com/cypress-io/cypress/commit/0e7b555f93fb403f431c5de4a07ae7ad6ac89ba2))
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### BREAKING CHANGES
|
|
35
|
-
|
|
36
|
-
* new version of packages for Cypress v10
|
|
37
|
-
|
|
38
|
-
# [@cypress/webpack-dev-server-v1.8.4](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.3...@cypress/webpack-dev-server-v1.8.4) (2022-03-29)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### Bug Fixes
|
|
42
|
-
|
|
43
|
-
* **deps:** add 'lodash' to webpack-dev-server plugin dependencies ([#20815](https://github.com/cypress-io/cypress/issues/20815)) ([a472427](https://github.com/cypress-io/cypress/commit/a4724271601aff110c68ae4364e68764f22cd12c))
|
|
44
|
-
|
|
45
|
-
# [@cypress/webpack-dev-server-v1.8.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.2...@cypress/webpack-dev-server-v1.8.3) (2022-03-15)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Bug Fixes
|
|
49
|
-
|
|
50
|
-
* **webpack-dev-server:** do not encodeUri in loader ([#20575](https://github.com/cypress-io/cypress/issues/20575)) ([1b152fc](https://github.com/cypress-io/cypress/commit/1b152fca1b9ed9894cf7a5b2a964c856f73fc685)), closes [#20593](https://github.com/cypress-io/cypress/issues/20593)
|
|
51
|
-
|
|
52
|
-
# [@cypress/webpack-dev-server-v1.8.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.1...@cypress/webpack-dev-server-v1.8.2) (2022-03-03)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### Bug Fixes
|
|
56
|
-
|
|
57
|
-
* avoid nextjs unsafeCache and watchOptions ([#20440](https://github.com/cypress-io/cypress/issues/20440)) ([9f60901](https://github.com/cypress-io/cypress/commit/9f6090170b0675d25b26b98cd0f987a5e395ab78))
|
|
58
|
-
* error regression - strip ansi colors out of cy.fixture() error message ([#20335](https://github.com/cypress-io/cypress/issues/20335)) ([e0bd6ac](https://github.com/cypress-io/cypress/commit/e0bd6ac2aaf8d00b9233fffefed8f6ed2484bf45))
|
|
59
|
-
|
|
60
|
-
# [@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)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### Bug Fixes
|
|
64
|
-
|
|
65
|
-
* 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))
|
|
66
|
-
|
|
67
|
-
# [@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)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### Features
|
|
71
|
-
|
|
72
|
-
* use hoisted yarn install in binary build ([#17285](https://github.com/cypress-io/cypress/issues/17285)) ([e4f5b10](https://github.com/cypress-io/cypress/commit/e4f5b106d49d6ac0857c5fdac886f83b99558c88))
|
|
73
|
-
|
|
74
|
-
# [@cypress/webpack-dev-server-v1.7.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.6.0...@cypress/webpack-dev-server-v1.7.0) (2021-10-15)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### Features
|
|
78
|
-
|
|
79
|
-
* normalized signatures webpack & vite servers ([#18379](https://github.com/cypress-io/cypress/issues/18379)) ([8f5308f](https://github.com/cypress-io/cypress/commit/8f5308f7068b80fb877da539ce34fb67ba497c4f))
|
|
80
|
-
|
|
81
|
-
# [@cypress/webpack-dev-server-v1.6.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.5.0...@cypress/webpack-dev-server-v1.6.0) (2021-09-10)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
### Features
|
|
85
|
-
|
|
86
|
-
* allow usage of @react/plugins with cypress.config.js ([#17738](https://github.com/cypress-io/cypress/issues/17738)) ([da4b1e0](https://github.com/cypress-io/cypress/commit/da4b1e06ce33945aabddda0e6e175dc0e1b488a5))
|
|
87
|
-
|
|
88
|
-
# [@cypress/webpack-dev-server-v1.5.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.4.0...@cypress/webpack-dev-server-v1.5.0) (2021-08-30)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### Features
|
|
92
|
-
|
|
93
|
-
* support webpack-dev-server v4 ([#17918](https://github.com/cypress-io/cypress/issues/17918)) ([16e4759](https://github.com/cypress-io/cypress/commit/16e4759e0196f68c5f0525efb020211337748f94))
|
|
94
|
-
|
|
95
|
-
# [@cypress/webpack-dev-server-v1.4.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.3.1...@cypress/webpack-dev-server-v1.4.0) (2021-06-17)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
### Features
|
|
99
|
-
|
|
100
|
-
* **npm/webpack-dev-server,runner-ct:** Normalize webpack errors + general React/TS improvements ([#16613](https://github.com/cypress-io/cypress/issues/16613)) ([c0fc23a](https://github.com/cypress-io/cypress/commit/c0fc23a052e53354a8300dd3f783cb161ae161e1))
|
|
101
|
-
|
|
102
|
-
# [@cypress/webpack-dev-server-v1.3.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.3.0...@cypress/webpack-dev-server-v1.3.1) (2021-05-26)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### Bug Fixes
|
|
106
|
-
|
|
107
|
-
* encodeURI to correctly load specs with white space ([#16416](https://github.com/cypress-io/cypress/issues/16416)) ([116fe64](https://github.com/cypress-io/cypress/commit/116fe649d74e54da9dd84bf126f08f4b9162c5d3))
|
|
108
|
-
* Properly typecheck webpack-dev-server and fix several undefined issues ([#16503](https://github.com/cypress-io/cypress/issues/16503)) ([4bb1ecd](https://github.com/cypress-io/cypress/commit/4bb1ecd077fc3724e6c127982f98e1e6b0f1bb98))
|
|
109
|
-
|
|
110
|
-
# [@cypress/webpack-dev-server-v1.3.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.2.0...@cypress/webpack-dev-server-v1.3.0) (2021-05-13)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
### Features
|
|
114
|
-
|
|
115
|
-
* support webpack dev server v4 ([#16414](https://github.com/cypress-io/cypress/issues/16414)) ([0cea625](https://github.com/cypress-io/cypress/commit/0cea625f359ef554e87600ef7e7c3afa4e36da4d))
|
|
116
|
-
|
|
117
|
-
# [@cypress/webpack-dev-server-v1.2.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.6...@cypress/webpack-dev-server-v1.2.0) (2021-05-11)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
### Features
|
|
121
|
-
|
|
122
|
-
* exclude html pwa plugin in webpack dev server ([#16388](https://github.com/cypress-io/cypress/issues/16388)) ([14c2292](https://github.com/cypress-io/cypress/commit/14c22929badfe56385260a49336cf29e10902470))
|
|
123
|
-
|
|
124
|
-
# [@cypress/webpack-dev-server-v1.1.6](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.5...@cypress/webpack-dev-server-v1.1.6) (2021-04-30)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
### Bug Fixes
|
|
128
|
-
|
|
129
|
-
* update docs ([#16266](https://github.com/cypress-io/cypress/issues/16266)) ([72e064b](https://github.com/cypress-io/cypress/commit/72e064bd0705ae39830a2be2052534699862551a))
|
|
130
|
-
|
|
131
|
-
# [@cypress/webpack-dev-server-v1.1.5](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.4...@cypress/webpack-dev-server-v1.1.5) (2021-04-26)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
### Bug Fixes
|
|
135
|
-
|
|
136
|
-
* **component-testing:** correct imports for relative paths in cypress.json ([#16056](https://github.com/cypress-io/cypress/issues/16056)) ([10b89f8](https://github.com/cypress-io/cypress/commit/10b89f8d587d331256549c3ab7662f119df7a0f1))
|
|
137
|
-
* **webpack-dev-server:** remove hard dependency on html-webpack-plugin v4 ([#16108](https://github.com/cypress-io/cypress/issues/16108)) ([4cfe4b1](https://github.com/cypress-io/cypress/commit/4cfe4b1971c615d615c05ce35b9f7dd5ef8315fc))
|
|
138
|
-
* remove lazy-compile-webpack-plugin, make html-webpack-plugin a dependency ([#15954](https://github.com/cypress-io/cypress/issues/15954)) ([19136b6](https://github.com/cypress-io/cypress/commit/19136b6a131cffc31899c754cccce64ce1b4fb87))
|
|
139
|
-
* run-ct does not hang on windows anymore ([#16022](https://github.com/cypress-io/cypress/issues/16022)) ([6c12a6c](https://github.com/cypress-io/cypress/commit/6c12a6c7b706ee4f708a9d19c62f18cd0838a433))
|
|
140
|
-
|
|
141
|
-
# [@cypress/webpack-dev-server-v1.1.4](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.3...@cypress/webpack-dev-server-v1.1.4) (2021-04-21)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
### Bug Fixes
|
|
145
|
-
|
|
146
|
-
* **webpack:** allow load custom asset on windows ([#16099](https://github.com/cypress-io/cypress/issues/16099)) ([7340851](https://github.com/cypress-io/cypress/commit/7340851097c792ca0d8d3157c3d803dccdd905d2)), closes [#16097](https://github.com/cypress-io/cypress/issues/16097)
|
|
147
|
-
|
|
148
|
-
# [@cypress/webpack-dev-server-v1.1.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.2...@cypress/webpack-dev-server-v1.1.3) (2021-04-13)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### Bug Fixes
|
|
152
|
-
|
|
153
|
-
* ensure root el mounting exists, remove userland html webpack plugin ([#15870](https://github.com/cypress-io/cypress/issues/15870)) ([726120d](https://github.com/cypress-io/cypress/commit/726120da183cb6d89c83181761d21f09844a9fc2))
|
|
154
|
-
* make component testing windows compatible ([#15889](https://github.com/cypress-io/cypress/issues/15889)) ([602c762](https://github.com/cypress-io/cypress/commit/602c762cfd707ae497273ac38206d7f9d8545439))
|
|
155
|
-
* remove lazy-compile-webpack-plugin ([#15964](https://github.com/cypress-io/cypress/issues/15964)) ([dcf3b14](https://github.com/cypress-io/cypress/commit/dcf3b14f3668cba8e19cf4eecd80db0c726f4248))
|
|
156
|
-
* **webpack-dev-server:** remove output.publicPath from webpack-dev-server ([#15839](https://github.com/cypress-io/cypress/issues/15839)) ([8e894a0](https://github.com/cypress-io/cypress/commit/8e894a0fdb899be8dd8993319c9297ea73c10321))
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### Reverts
|
|
160
|
-
|
|
161
|
-
* Revert "fix: ensure root el mounting exists, remove userland html webpack plugin (#15870)" (#15949) ([1d271ea](https://github.com/cypress-io/cypress/commit/1d271ea209c9d5116d61ed9b147a75eda6a61210)), closes [#15870](https://github.com/cypress-io/cypress/issues/15870) [#15949](https://github.com/cypress-io/cypress/issues/15949)
|
|
162
|
-
|
|
163
|
-
# [@cypress/webpack-dev-server-v1.1.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.1...@cypress/webpack-dev-server-v1.1.2) (2021-04-06)
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
### Bug Fixes
|
|
167
|
-
|
|
168
|
-
* **component-testing:** Correctly specify @cypress/webpack-dev-server peerDependencies ([#15820](https://github.com/cypress-io/cypress/issues/15820)) ([519b29c](https://github.com/cypress-io/cypress/commit/519b29cb897af59b84dc2f35752f785985348f2d))
|
|
169
|
-
|
|
170
|
-
# [@cypress/webpack-dev-server-v1.1.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.1.0...@cypress/webpack-dev-server-v1.1.1) (2021-04-05)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
### Bug Fixes
|
|
174
|
-
|
|
175
|
-
* **@cypress/react:** Devtools unpredictable resets ([#15612](https://github.com/cypress-io/cypress/issues/15612)) ([b1f831a](https://github.com/cypress-io/cypress/commit/b1f831a86a8bcc6646067bc8a9e67871026ff575)), closes [#15634](https://github.com/cypress-io/cypress/issues/15634)
|
|
176
|
-
* **component-testing:** Fix webpack-dev-server deps validation crash ([#15708](https://github.com/cypress-io/cypress/issues/15708)) ([254eb47](https://github.com/cypress-io/cypress/commit/254eb47d91c75a9f56162e7493ab83e5be169935))
|
|
177
|
-
|
|
178
|
-
# [@cypress/webpack-dev-server-v1.1.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.0.4...@cypress/webpack-dev-server-v1.1.0) (2021-03-15)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
### Bug Fixes
|
|
182
|
-
|
|
183
|
-
* **@cypress/react:** Correctly unmount react components ([#15250](https://github.com/cypress-io/cypress/issues/15250)) ([6b515c7](https://github.com/cypress-io/cypress/commit/6b515c777ca2fa599f21dc47d181fd28a7eb6db0))
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
### Features
|
|
187
|
-
|
|
188
|
-
* Use lazy compilation for webpack-dev-server by default ([#15158](https://github.com/cypress-io/cypress/issues/15158)) ([f237050](https://github.com/cypress-io/cypress/commit/f237050fdb49e4e59c07a70bb178d88d0e7387a8))
|
|
189
|
-
* webpack stop early when error in run mode ([4ec655b](https://github.com/cypress-io/cypress/commit/4ec655b784ff5f961f1d7ce371c5953d9116c576))
|
|
190
|
-
|
|
191
|
-
# [@cypress/webpack-dev-server-v1.0.4](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.0.3...@cypress/webpack-dev-server-v1.0.4) (2021-03-10)
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
### Bug Fixes
|
|
195
|
-
|
|
196
|
-
* trigger release of the packages ([#15405](https://github.com/cypress-io/cypress/issues/15405)) ([1ce5755](https://github.com/cypress-io/cypress/commit/1ce57554e260850472cf753de68858f47b3f7b3d))
|
|
197
|
-
|
|
198
|
-
# [@cypress/webpack-dev-server-v1.0.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.0.2...@cypress/webpack-dev-server-v1.0.3) (2021-02-18)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
### Bug Fixes
|
|
202
|
-
|
|
203
|
-
* missing index-template.html from package.json deps for webpack-dev-server ([#15151](https://github.com/cypress-io/cypress/issues/15151)) ([36b0440](https://github.com/cypress-io/cypress/commit/36b0440b663c6a0075d23d8d23ae14d47de297c8))
|
|
204
|
-
|
|
205
|
-
# [@cypress/webpack-dev-server-v1.0.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.0.1...@cypress/webpack-dev-server-v1.0.2) (2021-02-18)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
### Bug Fixes
|
|
209
|
-
|
|
210
|
-
* add webpack-dev-server to peerDependencies, improve peerDependency error handling, fix index-template.html path ([#15149](https://github.com/cypress-io/cypress/issues/15149)) ([2863e33](https://github.com/cypress-io/cypress/commit/2863e338920362cbb1ecf20c2fab28fbd3a52c33))
|
|
211
|
-
|
|
212
|
-
# [@cypress/webpack-dev-server-v1.0.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.0.0...@cypress/webpack-dev-server-v1.0.1) (2021-02-17)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
### Bug Fixes
|
|
216
|
-
|
|
217
|
-
* add a trivial change to trigger semantic release ([#15127](https://github.com/cypress-io/cypress/issues/15127)) ([fb7540e](https://github.com/cypress-io/cypress/commit/fb7540e99d56e0cff89aaf2fe76065b9815bdbec))
|
|
218
|
-
* trigger semantic release ([#15128](https://github.com/cypress-io/cypress/issues/15128)) ([3a6f3b1](https://github.com/cypress-io/cypress/commit/3a6f3b1928277f7086062b1107f424e5a0247e00))
|
|
219
|
-
|
|
220
|
-
# @cypress/webpack-dev-server-v1.0.0 (2021-02-16)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
### Features
|
|
224
|
-
|
|
225
|
-
* component testing ([#14479](https://github.com/cypress-io/cypress/issues/14479)) ([af26fbe](https://github.com/cypress-io/cypress/commit/af26fbebe6bc609132013a0493a116cc78bb1bd4))
|