Merge pull request #179 from electron-vite/dev

chore: some optimization
This commit is contained in:
草鞋没号 2022-07-03 06:42:57 +08:00 committed by GitHub
commit 07a342951a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 85 deletions

View File

@ -1,5 +1,6 @@
---
name: Bug_Report
name: 🐞 Bug report
about: Create a report to help us improve
title: "[Bug] the title of bug report"
labels: bug
@ -7,23 +8,4 @@ assignees: ''
---
#### What did I do
Something you have done.
#### What happened
Get an error.
#### Expected
What is the expected result.
#### Environment
- OS: OS version, e.g. macOS Big Sur 11.1
- electron-vue-vite version (or commit hash), e.g. v1.0.0
#### More detail
More detail like screenshot
#### Describe the bug

View File

@ -1,24 +0,0 @@
---
name: Feature_Want
about: Suggest an idea for electron-vue-vite
title: "[Feature] the title of Feature_Want report"
labels: feature
assignees: ''
---
#### Motivation
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
#### Detailed design
Describe the solution you'd like, a clear and concise description of what you want to happen.
#### Alternatives
Describe alternatives you've considered, what other designs have been considered? What is the impact of not doing this?
#### More detail (optional)
Add any other context or screenshots about the feature request here.

View File

@ -1,16 +1,10 @@
---
name: Help_Wanted
name: 🥺 Help wanted
about: Confuse about the use of electron-vue-vite
title: "[Help] the title of Help_Want report"
title: "[Help] the title of help wanted report"
labels: help wanted
assignees: ''
---
#### Describe the problem you Confuse
A clear and concise description of what you are confusing about.
#### More detail (optional)
Add any other context or screenshots.
#### Describe the problem you confuse

View File

@ -50,31 +50,26 @@ npm create electron-vite
**Put Node.js packages in `dependencies`**
🚨 e.g.
- `electron-store`
- `sqlite3`
- `serilaport`
- `mongodb`
- ...others Node.js packages
**e.g.** `electron-store` `sqlite3` `serilaport` `mongodb` ...others
**Put Web packages in `devDependencies`**
🚨 e.g.
- `vue`
- `vue-router`
- `vuex`
- `pinia`
- `element-plus`
- `ant-design-vue`
- `axios`
- ...others Web packages
**TODO: ESM packages**
- `node-fetch`
- `execa`
- ...others ESM packages
**e.g.** `vue` `vue-router` `vuex` `pinia` `element-plus` `ant-design-vue` `axios` ...others
See more 👉 [dependencies vs devDependencies](https://github.com/electron-vite/vite-plugin-electron-renderer#dependencies-vs-devdependencies)
## 🚨 ESM packages
**e.g.** `node-fetch` `execa` `got` ...others
1. `npm i vite-plugin-esmodule -D`
2. Configure in vite.config.ts
```ts
import esmodule from 'vite-plugin-esmodule'
export default {
plugins: [
esmodule(['got', 'execa', 'node-fetch']),
],
}
```

View File

@ -19,8 +19,7 @@
"electron-builder": "^23.0.3",
"typescript": "^4.7.3",
"vite": "^2.9.13",
"vite-plugin-electron": "^0.6.1",
"vite-plugin-resolve": "^2.1.2",
"vite-plugin-electron": "^0.6.2",
"vue": "^3.2.36",
"vue-tsc": "^0.36.0"
},

View File

@ -6,9 +6,5 @@
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true
},
"include": [
"vite.config.ts",
"vite.config.electron.ts",
"package.json"
]
"include": ["vite.config.ts", "electron", "package.json"]
}

View File

@ -16,7 +16,6 @@ export default defineConfig({
entry: 'electron/main/index.ts',
vite: {
build: {
sourcemap: false,
outDir: 'dist/electron/main',
},
},