feat(dev): 配置 VSCode 开发环境并优化项目设置

This commit is contained in:
严浩
2025-09-09 11:52:41 +08:00
parent 5f082a9bc9
commit 8a0a98fc11
10 changed files with 2522 additions and 886 deletions

2
.gitignore vendored
View File

@@ -18,8 +18,6 @@ coverage
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*

14
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Firefox Dev Edition",
"type": "firefox",
"request": "launch",
"url": "http://localhost:4730/",
"webRoot": "${workspaceFolder}",
"firefoxExecutable": "/Applications/Firefox Nightly.app/Contents/MacOS/firefox",
"preLaunchTask": "🚀 dev"
}
]
}

7
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}

33
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "🚀 dev",
"type": "shell",
"command": "pnpm run dev",
"isBackground": true,
"problemMatcher": {
"owner": "vite",
"pattern": {
"regexp": "."
},
"background": {
"activeOnStart": true,
"beginsPattern": ".*VITE.*",
"endsPattern": ".*ready in.*"
}
},
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"runOptions": {
"instanceLimit": 1
}
}
]
}

View File

@@ -1,8 +1,8 @@
import { test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test'
// See here how to get started:
// https://playwright.dev/docs/intro
test('visits the app root url', async ({ page }) => {
await page.goto('/');
await expect(page.locator('h1')).toHaveText('You did it!');
await page.goto('/')
await expect(page.locator('h1')).toHaveText('You did it!')
})

View File

@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>

View File

@@ -1,4 +1,5 @@
{
"packageManager": "pnpm@10.15.1",
"name": "vue-ts-example-2025",
"version": "0.0.0",
"private": true,
@@ -7,7 +8,7 @@
"node": "^20.19.0 || >=22.12.0"
},
"scripts": {
"dev": "vite",
"dev": "vite --port 4730 --host --strictPort",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",

3321
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,14 +7,10 @@ import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueJsx(),
vueDevTools(),
],
plugins: [vue(), vueJsx(), vueDevTools()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})