]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
refactor!: rename `serve` to `preview` and donot depend on pre-scripts
authorHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 17 Nov 2021 07:38:52 +0000 (15:38 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 17 Nov 2021 08:55:56 +0000 (16:55 +0800)
1. `pnpm` doesn't run pre-scripts by default, the project will work
inconsistenly when run by different package managers.
2. The rename is to be consistent with Vite: https://github.com/vitejs/vite/pull/5483

.npmrc [deleted file]
template/base/package.json
template/config/cypress/package.json
utils/generateReadme.js

diff --git a/.npmrc b/.npmrc
deleted file mode 100644 (file)
index 6c59086..0000000
--- a/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-enable-pre-post-scripts=true
index 39e5fe176d2dec218b90596c203a60d7f4a7b8a0..a5691b0db2a300c1d6bdac74a615cb0b8f5a5896 100644 (file)
@@ -2,8 +2,7 @@
   "scripts": {
     "dev": "vite",
     "build": "vite build",
-    "preserve": "vite build",
-    "serve": "vite preview --port 5050"
+    "preview": "vite preview --port 5050"
   },
   "dependencies": {
     "vue": "^3.2.22"
index 12de1110d3987e41b9bd5c9738b3c28632c5d7ce..c372ddea10e430d352039cfba531065c211bc8cc 100644 (file)
@@ -2,8 +2,8 @@
   "scripts": {
     "test:unit": "cypress open-ct",
     "test:unit:ci": "cypress run-ct --quiet --reporter spec",
-    "test:e2e": "start-server-and-test serve 5050 'cypress open'",
-    "test:e2e:ci": "start-server-and-test serve 5050 'cypress run'"
+    "test:e2e": "start-server-and-test preview 5050 'cypress open'",
+    "test:e2e:ci": "start-server-and-test preview 5050 'cypress run'"
   },
   "devDependencies": {
     "@cypress/vite-dev-server": "^2.2.0",
index ad6e14ca2ff426b35c4f730277bfbe1f5a4d9e9b..03b32c1c4b56e97f4b080fb6c3b6664de9b6c19b 100644 (file)
@@ -63,6 +63,7 @@ ${getCommand(packageManager, 'test:unit')} # or \`${getCommand(
 ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
 
 \`\`\`sh
+${getCommand(packageManager, 'build')}
 ${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(
       packageManager,
       'test:e2e:ci'