打包配置完善

This commit is contained in:
草鞋没号 2020-08-17 09:16:26 +08:00
parent 8f8d79cf77
commit 4ac8a08ca2
4 changed files with 44 additions and 8 deletions

View File

@ -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"

View File

@ -20,8 +20,11 @@ module.exports = (env = 'production') => {
external: [
'fs',
'path',
'http',
'https',
'child_process',
'os',
'electron',
'electron-is-dev',
],
}
};

View File

@ -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>

View File

@ -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