Skip to content

Commit 2584397

Browse files
committed
chore: change default preview port to 4173
The default preview port was changed to 4173 in Vite 2.8: <https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#280-2022-02-09> To avoid Vite preview server auto-increment the port number in the case that port 4173 is occupied, therefore failing E2E tests unexpectedly, we still have to explicitly set the port number in the npm scripts.
1 parent 9e93799 commit 2584397

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

template/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"scripts": {
33
"dev": "vite",
44
"build": "vite build",
5-
"preview": "vite preview --port 5050"
5+
"preview": "vite preview --port 4173"
66
},
77
"dependencies": {
88
"vue": "^3.2.36"

template/config/cypress-ct/cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"baseUrl": "http://localhost:5050",
2+
"baseUrl": "http://localhost:4173",
33
"component": {
44
"componentFolder": "src",
55
"testFiles": "**/__tests__/*.spec.{js,ts,jsx,tsx}"

template/config/cypress/cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"baseUrl": "http://localhost:5050"
2+
"baseUrl": "http://localhost:4173"
33
}

template/config/cypress/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"scripts": {
3-
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
4-
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'"
3+
"test:e2e": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress open'",
4+
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress run'"
55
},
66
"devDependencies": {
77
"cypress": "^9.7.0",

0 commit comments

Comments
 (0)