mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
59 lines
1.3 KiB
JavaScript
Executable File
59 lines
1.3 KiB
JavaScript
Executable File
import path from "path"
|
|
import aliases from "./aliases"
|
|
|
|
import { defineConfig } from "vite"
|
|
import react from "@vitejs/plugin-react"
|
|
|
|
const oneYearInSeconds = 60 * 60 * 24 * 365
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
],
|
|
resolve: {
|
|
alias: aliases,
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
port: 8000,
|
|
fs: {
|
|
allow: ["..", "../../"],
|
|
},
|
|
https: {
|
|
key: path.join(__dirname, ".ssl", "privkey.pem"),
|
|
cert: path.join(__dirname, ".ssl", "cert.pem"),
|
|
},
|
|
headers: {
|
|
"Strict-Transport-Security": `max-age=${oneYearInSeconds}`
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
}
|
|
}
|
|
},
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
target: "esnext"
|
|
}
|
|
},
|
|
build: {
|
|
target: "esnext",
|
|
rollupOptions: {
|
|
output:{
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules')) {
|
|
return id.toString().split('node_modules/')[1].split('/')[0].toString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
esbuild: {
|
|
supported: {
|
|
"top-level-await": true //browsers can handle top-level-await features
|
|
},
|
|
}
|
|
}) |