@cypress/webpack-dev-server 6.2.0 → 6.2.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.
|
@@ -8,6 +8,7 @@ const os_1 = require("os");
|
|
|
8
8
|
const path = tslib_1.__importStar(require("path"));
|
|
9
9
|
const sourceRelativeWebpackModules_1 = require("./sourceRelativeWebpackModules");
|
|
10
10
|
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
11
|
+
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
11
12
|
const debugPrefix = 'cypress:webpack-dev-server:angularHandler';
|
|
12
13
|
const debug = (0, debug_1.default)(debugPrefix);
|
|
13
14
|
async function getProjectConfig(projectRoot) {
|
|
@@ -85,7 +86,14 @@ async function generateTsConfig(devServerConfig, buildOptions) {
|
|
|
85
86
|
const { workspaceRoot = projectRoot } = buildOptions;
|
|
86
87
|
const specPattern = Array.isArray(cypressConfig.specPattern) ? cypressConfig.specPattern : [cypressConfig.specPattern];
|
|
87
88
|
const getProjectFilePath = (...fileParts) => (0, exports.toPosix)(path.join(...fileParts));
|
|
88
|
-
|
|
89
|
+
// `**/*.cy.{ts,tsx}` becomes `**/*.cy.ts` and `**/*.cy.tsx`. TypeScript's
|
|
90
|
+
// `include` only understands `*`, `?` and `**/`, so a brace pattern, such as
|
|
91
|
+
// the default specPattern, would match no files. Expanding before joining
|
|
92
|
+
// projectRoot keeps braces in the project's own path literal. The result
|
|
93
|
+
// stays a list of globs rather than files because @ngtools/webpack re-reads
|
|
94
|
+
// `include` on every rebuild, which is how it picks up a newly created spec.
|
|
95
|
+
const expandedSpecPatterns = new Set(specPattern.flatMap((pattern) => micromatch_1.default.braces(pattern, { expand: true })));
|
|
96
|
+
const includePaths = [...expandedSpecPatterns].map((pattern) => getProjectFilePath(projectRoot, pattern));
|
|
89
97
|
if (cypressConfig.supportFile) {
|
|
90
98
|
includePaths.push((0, exports.toPosix)(cypressConfig.supportFile));
|
|
91
99
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/webpack-dev-server",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"description": "Launches Webpack Dev Server for Component Testing",
|
|
5
5
|
"homepage": "https://github.com/cypress-io/cypress/tree/develop/npm/webpack-dev-server#readme",
|
|
6
6
|
"bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"fs-extra": "9.1.0",
|
|
35
35
|
"html-webpack-plugin-5": "npm:html-webpack-plugin@^5",
|
|
36
36
|
"local-pkg": "0.4.1",
|
|
37
|
+
"micromatch": "^4.0.8",
|
|
37
38
|
"semver": "^7.7.3",
|
|
38
39
|
"tslib": "^2.3.1",
|
|
39
40
|
"tsx": "^4.23.12",
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@angular-devkit/core": "^21.2.7",
|
|
46
47
|
"@packages/eslint-config": "0.0.0-development",
|
|
48
|
+
"@types/micromatch": "4.0.10",
|
|
47
49
|
"@types/node": "24.10.1",
|
|
48
50
|
"@types/semver": "^7.5.0",
|
|
49
51
|
"@types/webpack-bundle-analyzer": "4.7.0",
|