pimi-launcher/electron.vite.config.js

44 lines
1.3 KiB
JavaScript
Raw Normal View History

2023-06-19 18:48:01 +03:00
// Copyright (c) 2023 artegoser (Artemy Egorov)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2023-06-19 17:28:04 +03:00
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
2023-06-19 18:41:52 +03:00
import commonjsExternals from 'vite-plugin-commonjs-externals'
2023-06-21 14:51:56 +03:00
const externals = ['pimi-launcher-core', 'path', 'process', 'fs', 'console']
2023-06-19 17:28:04 +03:00
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/src')
}
},
2023-06-19 18:41:52 +03:00
plugins: [
react(),
commonjsExternals({
externals
})
]
2023-06-19 17:28:04 +03:00
}
})