@cypress/webpack-dev-server 6.1.0 → 6.1.2
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/dist/CypressCTWebpackPlugin.js +18 -11
- package/dist/devServer.js +16 -19
- package/package.json +2 -2
|
@@ -39,17 +39,24 @@ class CypressCTWebpackPlugin {
|
|
|
39
39
|
callback();
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
let files;
|
|
43
|
+
let foundFiles;
|
|
44
|
+
// onSpecsChange can replace the list while the checks are pending. Checking again until
|
|
45
|
+
// the list holds still means this compile builds the newest list, filtered.
|
|
46
|
+
do {
|
|
47
|
+
files = this.files;
|
|
48
|
+
// Ensure we don't try to load files that have been removed from the file system
|
|
49
|
+
// but have not yet been detected by the onSpecsChange handler
|
|
50
|
+
foundFiles = await Promise.all(files.map(async (file) => {
|
|
51
|
+
try {
|
|
52
|
+
const exists = await fs_extra_1.default.pathExists(file.absolute);
|
|
53
|
+
return exists ? file : null;
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
} while (this.files !== files);
|
|
53
60
|
this.files = foundFiles.filter((file) => file !== null);
|
|
54
61
|
callback();
|
|
55
62
|
};
|
package/dist/devServer.js
CHANGED
|
@@ -17,26 +17,23 @@ const debug = (0, debug_1.default)('cypress:webpack-dev-server:devServer');
|
|
|
17
17
|
*
|
|
18
18
|
* @param config
|
|
19
19
|
*/
|
|
20
|
-
function devServer(devServerConfig) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
debug('closed dev server');
|
|
35
|
-
});
|
|
36
|
-
},
|
|
20
|
+
async function devServer(devServerConfig) {
|
|
21
|
+
const result = await devServer.create(devServerConfig);
|
|
22
|
+
await result.server.start();
|
|
23
|
+
if (!result.server.options.port) {
|
|
24
|
+
throw new Error(`Expected port ${result.server.options.port} to be a number`);
|
|
25
|
+
}
|
|
26
|
+
debug(`Component testing webpack server ${result.version} started on port %s`, result.server.options.port);
|
|
27
|
+
return {
|
|
28
|
+
port: result.server.options.port,
|
|
29
|
+
// Close is for unit testing only. We kill this child process which will handle the closing of the server
|
|
30
|
+
close: async (done) => {
|
|
31
|
+
debug('closing dev server');
|
|
32
|
+
result.server.stop().then(() => done?.()).catch(done).finally(() => {
|
|
33
|
+
debug('closed dev server');
|
|
37
34
|
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
35
|
+
},
|
|
36
|
+
};
|
|
40
37
|
}
|
|
41
38
|
exports.devServer = devServer;
|
|
42
39
|
const thirdPartyDefinitionPrefixes = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/webpack-dev-server",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"description": "Launches Webpack Dev Server for Component Testing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
|
48
|
-
"url": "https://github.com/cypress-io/cypress.git"
|
|
48
|
+
"url": "git+https://github.com/cypress-io/cypress.git"
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/cypress-io/cypress/tree/develop/npm/webpack-dev-server#readme",
|
|
51
51
|
"bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
|