48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import { resolve } from 'path'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
var clientPort = process.env.CLIENT_PORT == null ? 8080 : parseInt(process.env.CLIENT_PORT);
|
|
var serverPort = process.env.SERVER_PORT == null ? 8085 : parseInt(process.env.SERVER_PORT);
|
|
serverPort = process.env.SERVER_PROXY_PORT == null ? serverPort : parseInt(process.env.SERVER_PROXY_PORT);
|
|
|
|
var proxy = {
|
|
target: `http://127.0.0.1:${serverPort}/`,
|
|
changeOrigin: false,
|
|
secure: false,
|
|
ws: true
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins:[
|
|
tailwindcss()
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
index: resolve(__dirname, './src/Client/main.html'),
|
|
},
|
|
output: {
|
|
// TODO: Extra chunking of deps
|
|
// manualChunks: {
|
|
// vendor: vendorDeps,
|
|
// ...chunksFromDeps(dependencies, vendorDeps)
|
|
// },
|
|
entryFileNames: 'js/[name].js',
|
|
//chunkFileNames: 'js/[name].[hash].chunk.js',
|
|
assetFileNames: '[ext]/[name].[ext]',
|
|
},
|
|
},
|
|
minify: "oxc",
|
|
},
|
|
server: {
|
|
port: clientPort,
|
|
host: '0.0.0.0',
|
|
https: false,
|
|
cors: true,
|
|
proxy: {
|
|
'/': proxy,
|
|
}
|
|
},
|
|
})
|