diff --git a/.gitignore b/.gitignore
index 2650bf1..4936a1f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,29 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
node_modules
-.DS_Store
dist
dist-ssr
*.local
-.debug.env
-tmp
-**/.tmp
-release
+# Editor directories and files
+# .vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+.vscode/.debug.env
+package-lock.json
+pnpm-lock.yaml
+yarn.lock
\ No newline at end of file
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..275b440
--- /dev/null
+++ b/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+ Vite App
+
+
+
+
+
+
diff --git a/package.json b/package.json
index 3af0afc..f7f132e 100644
--- a/package.json
+++ b/package.json
@@ -1,33 +1,27 @@
{
"name": "electron-vue-vite",
"version": "1.0.0",
- "main": "dist/main/index.cjs",
+ "main": "dist/electron-main/index.cjs",
"author": "草鞋没号 <308487730@qq.com>",
"license": "MIT",
+ "private": true,
"scripts": {
- "dev": "node scripts/watch.mjs",
- "prebuild": "vue-tsc --noEmit --p packages/renderer/tsconfig.json && node scripts/build.mjs",
- "build": "electron-builder",
- "init": "git config core.hooksPath .git/hooks/ && rm -rf .git/hooks && npx simple-git-hooks",
- "test:e2e": "npx playwright test",
- "test:e2e:headless": "npx playwright test --headed"
+ "dev": "vite",
+ "build": "vue-tsc --noEmit && vite build && electron-builder"
},
"engines": {
"node": ">=14.17.0"
},
"devDependencies": {
- "@playwright/test": "^1.22.2",
- "@vitejs/plugin-vue": "^2.3.2",
- "electron": "19.0.1",
+ "@vitejs/plugin-vue": "^2.3.3",
+ "electron": "^19.0.3",
"electron-builder": "^23.0.3",
- "nano-staged": "^0.8.0",
- "simple-git-hooks": "^2.8.0",
- "typescript": "^4.7.2",
- "vite": "^2.9.8",
+ "typescript": "^4.7.3",
+ "vite": "^2.9.9",
"vite-plugin-electron": "^0.4.5",
"vite-plugin-resolve": "^2.1.2",
"vue": "^3.2.36",
- "vue-tsc": "^0.35.2"
+ "vue-tsc": "^0.36.0"
},
"env": {
"VITE_DEV_SERVER_HOST": "127.0.0.1",
@@ -40,4 +34,4 @@
"vue3",
"vue"
]
-}
+}
\ No newline at end of file
diff --git a/public/favicon.ico b/public/favicon.ico
new file mode 100644
index 0000000..df36fcf
Binary files /dev/null and b/public/favicon.ico differ
diff --git a/src/App.vue b/src/App.vue
new file mode 100644
index 0000000..1503baf
--- /dev/null
+++ b/src/App.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
diff --git a/src/assets/logo.png b/src/assets/logo.png
new file mode 100644
index 0000000..f3d2503
Binary files /dev/null and b/src/assets/logo.png differ
diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue
new file mode 100644
index 0000000..38dae70
--- /dev/null
+++ b/src/components/HelloWorld.vue
@@ -0,0 +1,52 @@
+
+
+
+ {{ msg }}
+
+
+ Recommended IDE setup:
+ VS Code
+ +
+ Volar
+
+
+ See README.md
for more information.
+
+
+
+ Vite Docs
+
+ |
+ Vue 3 Docs
+
+
+
+
+ Edit
+ components/HelloWorld.vue
to test hot module replacement.
+
+
+
+
diff --git a/src/env.d.ts b/src/env.d.ts
new file mode 100644
index 0000000..aafef95
--- /dev/null
+++ b/src/env.d.ts
@@ -0,0 +1,8 @@
+///
+
+declare module '*.vue' {
+ import type { DefineComponent } from 'vue'
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
+ const component: DefineComponent<{}, {}, any>
+ export default component
+}
diff --git a/src/main.ts b/src/main.ts
new file mode 100644
index 0000000..01433bc
--- /dev/null
+++ b/src/main.ts
@@ -0,0 +1,4 @@
+import { createApp } from 'vue'
+import App from './App.vue'
+
+createApp(App).mount('#app')
diff --git a/tsconfig.json b/tsconfig.json
index c6bb3d2..f1fb808 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,5 +13,8 @@
"paths": {},
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
- }
+ },
+ "references": [
+ { "path": "./tsconfig.node.json" }
+ ]
}
diff --git a/tsconfig.node.json b/tsconfig.node.json
new file mode 100644
index 0000000..65dbdb9
--- /dev/null
+++ b/tsconfig.node.json
@@ -0,0 +1,8 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Node"
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 0000000..315212d
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from 'vite'
+import vue from '@vitejs/plugin-vue'
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [vue()]
+})