2021-11-01 19:30:15 +08:00
|
|
|
import { join } from 'path'
|
2021-11-01 10:06:07 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import react from '@vitejs/plugin-react'
|
2021-11-15 19:14:50 +08:00
|
|
|
import styleImport from 'vite-plugin-style-import'
|
2021-11-09 10:17:06 +08:00
|
|
|
import pkg from '../package.json'
|
2021-11-01 10:06:07 +08:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2021-11-26 08:48:00 +08:00
|
|
|
mode: process.env.NODE_ENV,
|
2021-11-11 12:46:00 +08:00
|
|
|
root: join(__dirname, '../src/renderer'),
|
2021-12-09 09:16:48 +08:00
|
|
|
publicDir: join(__dirname, '../src/renderer/public'),
|
2021-11-15 19:14:50 +08:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
styleImport({
|
|
|
|
libs: [{
|
|
|
|
libraryName: 'antd',
|
|
|
|
esModule: true,
|
|
|
|
resolveStyle: (name) => `antd/es/${name}/style/index`,
|
|
|
|
},],
|
|
|
|
}),
|
|
|
|
],
|
2021-11-01 19:30:15 +08:00
|
|
|
base: './',
|
|
|
|
build: {
|
2021-11-08 19:17:39 +08:00
|
|
|
emptyOutDir: true,
|
2021-11-12 09:01:40 +08:00
|
|
|
outDir: '../../dist/renderer',
|
2021-11-01 19:30:15 +08:00
|
|
|
},
|
2021-11-15 19:14:50 +08:00
|
|
|
css: {
|
|
|
|
preprocessorOptions: {
|
|
|
|
less: {
|
|
|
|
javascriptEnabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-11-01 20:56:49 +08:00
|
|
|
server: {
|
|
|
|
host: pkg.env.HOST,
|
|
|
|
port: pkg.env.PORT,
|
|
|
|
},
|
2021-11-01 10:06:07 +08:00
|
|
|
})
|