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
42
package.json
42
package.json
@ -6,11 +6,43 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run dev:all",
|
"dev": "npm run dev:all",
|
||||||
"dev:all": "concurrently -n=vue,ele -c=green,blue \"npm run vue:dev\" \"npm run ele:dev\"",
|
"dev:all": "concurrently -n=vue,ele -c=green,blue \"npm run dev:vue\" \"npm run dev:ele\"",
|
||||||
"vue:dev": "vite",
|
"dev:vue": "vite",
|
||||||
"vue:build": "vite build",
|
"dev:ele": "node script/build --env=development --watch",
|
||||||
"ele:build": "node script/build --env=production",
|
"build:vue": "vite build",
|
||||||
"ele:dev": "node script/build --env=development --watch"
|
"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": {
|
"dependencies": {
|
||||||
"vue": "^3.0.0-rc.1"
|
"vue": "^3.0.0-rc.1"
|
||||||
|
@ -20,8 +20,11 @@ module.exports = (env = 'production') => {
|
|||||||
external: [
|
external: [
|
||||||
'fs',
|
'fs',
|
||||||
'path',
|
'path',
|
||||||
|
'http',
|
||||||
|
'https',
|
||||||
|
'child_process',
|
||||||
|
'os',
|
||||||
'electron',
|
'electron',
|
||||||
'electron-is-dev',
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<img style="height:200px;" src="./assets/electron.png" alt="Electron logo">
|
<img style="height:200px;" src="./assets/electron.png" alt="Electron logo">
|
||||||
<img alt="Vue logo" src="./assets/logo.png" />
|
<img alt="Vue logo" src="./assets/logo.png" />
|
||||||
</div>
|
</div>
|
||||||
<HelloWorld msg="Hello Electron 9.0 + Vue 3.0 + Vite" />
|
<HelloWorld msg="Hello Electron 9.0 + Vue 3.0 Vite" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -10,6 +10,7 @@ dotenv.config({ path: join(__dirname, '.env') })
|
|||||||
const config: UserConfig = {
|
const config: UserConfig = {
|
||||||
root: join(__dirname, 'src/render'),
|
root: join(__dirname, 'src/render'),
|
||||||
port: +process.env.PORT,
|
port: +process.env.PORT,
|
||||||
|
base: './',
|
||||||
}
|
}
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user