Skip to content

Commit d2de4d5

Browse files
Copilotcyanzhong
andcommitted
Add vitest.config.mts to prevent deploy side-effect during tests
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
1 parent ef202f5 commit d2de4d5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "1.0.0",
44
"description": "MarkEdit grammar checker based on Harper.",
55
"scripts": {
6-
"build": "vite build",
7-
"precheck": "yarn lint && yarn test",
6+
"build": "yarn lint && yarn test && vite build",
87
"lint": "eslint .",
98
"test": "vitest run",
109
"reload": "osascript -e 'quit app \"MarkEdit\"' -e 'delay 1' -e 'launch app \"MarkEdit\"'",

vitest.config.mts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'vitest/config';
2+
import mainPackage from './package.json' with { type: 'json' };
3+
4+
export default defineConfig({
5+
define: {
6+
__PKG_VERSION__: JSON.stringify(mainPackage.version),
7+
},
8+
});

0 commit comments

Comments
 (0)