Added vite build

This commit is contained in:
Kawanaao 2023-12-02 12:55:38 +02:00
parent 1eee28ad37
commit c49f93572e
No known key found for this signature in database
GPG key ID: 5B7A8DDCE861E7DC
3 changed files with 32 additions and 4 deletions

View file

@ -1,4 +1,4 @@
{
"contributors": ["azukaar", "jwr1", "Jogai", "InterN0te", "catmandx", "revam"],
"contributors": ["azukaar", "jwr1", "Jogai", "InterN0te", "catmandx", "revam", "Kawanaao"],
"message": "We require contributors to sign our [Contributor License Agreement](https://github.com/azukaar/Cosmos-Server/blob/master/cla.md). In order for us to review and merge your code, add yourself to the .clabot file as contributor, as a way of signing the CLA."
}

20
vite.config.js Normal file
View file

@ -0,0 +1,20 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
root: 'client',
build: {
outDir: '../static',
},
server: {
proxy: {
'/cosmos/api': {
target: 'https://localhost:8443',
secure: false,
ws: true,
}
}
}
})

View file

@ -71,14 +71,22 @@ module.exports = {
new CssMinimizerPlugin(),
new TerserPlugin({
minify: TerserPlugin.swcMinify,
parallel: true,
extractComments: "all",
terserOptions: {
mangle: true,
compress: true,
sourceMap: false,
}
})
}),
new TerserPlugin({
minify: TerserPlugin.uglifyJsMinify
}),
new TerserPlugin({
minify: TerserPlugin.esbuildMinify
}),
new TerserPlugin({
minify: TerserPlugin.terserMinify
}),
]
}
};