mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-31 20:16:36 +08:00
打包配置完善
This commit is contained in:
parent
8f8d79cf77
commit
4ac8a08ca2
44
package.json
44
package.json
@ -6,11 +6,43 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "npm run dev:all",
|
||||
"dev:all": "concurrently -n=vue,ele -c=green,blue \"npm run vue:dev\" \"npm run ele:dev\"",
|
||||
"vue:dev": "vite",
|
||||
"vue:build": "vite build",
|
||||
"ele:build": "node script/build --env=production",
|
||||
"ele:dev": "node script/build --env=development --watch"
|
||||
"dev:all": "concurrently -n=vue,ele -c=green,blue \"npm run dev:vue\" \"npm run dev:ele\"",
|
||||
"dev:vue": "vite",
|
||||
"dev:ele": "node script/build --env=development --watch",
|
||||
"build:vue": "vite build",
|
||||
"build:ele": "node script/build --env=production",
|
||||
"build": "npm run build:vue && npm run build:ele && electron-builder"
|
||||
},
|
||||
"build": {
|
||||
"appId": "308487730@qq.com",
|
||||
"files": [
|
||||
"!node_modules",
|
||||
"src/main/**",
|
||||
"src/render/dist/**"
|
||||
],
|
||||
"mac": {
|
||||
"artifactName": "${productName}_setup_${version}.${ext}",
|
||||
"target": [
|
||||
"dmg"
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": [
|
||||
"x64"
|
||||
]
|
||||
}
|
||||
],
|
||||
"artifactName": "${productName}_setup_${version}.${ext}"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"deleteAppDataOnUninstall": false
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.0.0-rc.1"
|
||||
@ -39,4 +71,4 @@
|
||||
"vue3",
|
||||
"rollup"
|
||||
]
|
||||
}
|
||||
}
|
@ -20,8 +20,11 @@ module.exports = (env = 'production') => {
|
||||
external: [
|
||||
'fs',
|
||||
'path',
|
||||
'http',
|
||||
'https',
|
||||
'child_process',
|
||||
'os',
|
||||
'electron',
|
||||
'electron-is-dev',
|
||||
],
|
||||
}
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
<img style="height:200px;" src="./assets/electron.png" alt="Electron logo">
|
||||
<img alt="Vue logo" src="./assets/logo.png" />
|
||||
</div>
|
||||
<HelloWorld msg="Hello Electron 9.0 + Vue 3.0 + Vite" />
|
||||
<HelloWorld msg="Hello Electron 9.0 + Vue 3.0 Vite" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -10,6 +10,7 @@ dotenv.config({ path: join(__dirname, '.env') })
|
||||
const config: UserConfig = {
|
||||
root: join(__dirname, 'src/render'),
|
||||
port: +process.env.PORT,
|
||||
base: './',
|
||||
}
|
||||
|
||||
export default config
|
||||
|
Loading…
x
Reference in New Issue
Block a user