jewpms/vite.config.mts
user ac2f1292f0 feat(stock): 增加库存列表筛选和排序功能
- 为过滤参数添加操作符选择(等于、模糊匹配、大于、小于)
- 实现多条件筛选功能
- 添加每页显示条数选择
- 优化排序逻辑,固定 ID 列为第二排序条件
- 修复分页显示逻辑,适应每页显示全部的场景
- 优化 SQL 查询语句生成逻辑
2025-03-19 16:15:39 +08:00

72 lines
2.3 KiB
TypeScript

import { URL, fileURLToPath } from 'node:url';
import { defineConfig, normalizePath } from 'vite';
import vue from '@vitejs/plugin-vue';
import { viteStaticCopy } from 'vite-plugin-static-copy';
const { getAbsoluteFSPath } = await import('swagger-ui-dist');
const swaggerUiPath = getAbsoluteFSPath();
// eslint-disable-next-line prefer-const
const config = defineConfig({
plugins: [
vue(),
viteStaticCopy({
targets: [
{
src: [
`${normalizePath(swaggerUiPath)}/*.{js,css,html,png}`,
`!${normalizePath(swaggerUiPath)}/**/index.html`,
normalizePath(fileURLToPath(new URL('./dist/axios.min.js', import.meta.resolve('axios/package.json')))),
normalizePath(fileURLToPath(new URL('./src/main/webapp/swagger-ui/index.html', import.meta.url))),
],
dest: 'swagger-ui',
},
],
}),
],
root: fileURLToPath(new URL('./src/main/webapp/', import.meta.url)),
publicDir: fileURLToPath(new URL('./target/classes/static/public', import.meta.url)),
cacheDir: fileURLToPath(new URL('./target/.vite-cache', import.meta.url)),
build: {
emptyOutDir: true,
outDir: fileURLToPath(new URL('./target/classes/static/', import.meta.url)),
rollupOptions: {
input: {
app: fileURLToPath(new URL('./src/main/webapp/index.html', import.meta.url)),
},
external: ['vue-web-cam', '@ericblade/quagga2'],
},
},
resolve: {
alias: {
vue: '@vue/compat/dist/vue.esm-bundler.js',
'@': fileURLToPath(new URL('./src/main/webapp/app/', import.meta.url)),
'@content': fileURLToPath(new URL('./src/main/webapp/content/', import.meta.url)),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
},
define: {
I18N_HASH: '"generated_hash"',
SERVER_API_URL: '"/"',
APP_VERSION: `"${process.env.APP_VERSION ? process.env.APP_VERSION : 'DEV'}"`,
},
server: {
host: true,
port: 9000,
proxy: Object.fromEntries(
['/api', '/management', '/v3/api-docs', '/login'].map(res => [
res,
{
target: 'http://localhost:8080',
},
]),
),
allowedHosts: ['dev.vxnet.cn'], // 允许的域名
},
});
// jhipster-needle-add-vite-config - JHipster will add custom config
export default config;