]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
chore: change default preview port to 4173
authorHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 1 Jun 2022 06:16:51 +0000 (14:16 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 1 Jun 2022 06:19:21 +0000 (14:19 +0800)
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.

template/base/package.json
template/config/cypress-ct/cypress.json
template/config/cypress/cypress.json
template/config/cypress/package.json

index 6fc7aa052dff87070169c825e8805be815be323c..867abaa0b53e8a7dd380ded2ac8ed123937fe470 100644 (file)
@@ -2,7 +2,7 @@
   "scripts": {
     "dev": "vite",
     "build": "vite build",
-    "preview": "vite preview --port 5050"
+    "preview": "vite preview --port 4173"
   },
   "dependencies": {
     "vue": "^3.2.36"
index 3d372252f4614de4a3f3dfd52e9a14a21c6f37f0..a10a9035dff91f2b897e99d8087e0290d91d2cb7 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "baseUrl": "http://localhost:5050",
+  "baseUrl": "http://localhost:4173",
   "component": {
     "componentFolder": "src",
     "testFiles": "**/__tests__/*.spec.{js,ts,jsx,tsx}"
index 6ba19871b917c6da36deff7589c7ac77f7a03b90..fe9238dea5f6586aa95149b7283a8918f74f13b7 100644 (file)
@@ -1,3 +1,3 @@
 {
-  "baseUrl": "http://localhost:5050"
+  "baseUrl": "http://localhost:4173"
 }
index 6b885633c88f513adad2556070be6d43e91299ce..79bf45d094032baffb9bf6acb7884bda253d768f 100644 (file)
@@ -1,7 +1,7 @@
 {
   "scripts": {
-    "test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
-    "test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'"
+    "test:e2e": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress open'",
+    "test:e2e:ci": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress run'"
   },
   "devDependencies": {
     "cypress": "^9.7.0",