2026-02-04 17:47:51 +08:00
|
|
|
import { loadEnv } from 'vite';
|
|
|
|
|
import uni from '@dcloudio/vite-plugin-uni';
|
|
|
|
|
import path from 'path';
|
|
|
|
|
// import viteCompression from 'vite-plugin-compression';
|
|
|
|
|
import uniReadPagesV3Plugin from './sheep/router/utils/uni-read-pages-v3';
|
|
|
|
|
import mpliveMainfestPlugin from './sheep/libs/mplive-manifest-plugin';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default (command, mode) => {
|
|
|
|
|
const env = loadEnv(mode, __dirname, 'SHOPRO_');
|
|
|
|
|
return {
|
|
|
|
|
envPrefix: "SHOPRO_",
|
2026-02-06 14:32:50 +08:00
|
|
|
build: {
|
|
|
|
|
outDir: path.resolve(__dirname, '/saash5'),
|
|
|
|
|
},
|
2026-02-04 17:47:51 +08:00
|
|
|
plugins: [
|
|
|
|
|
uni(),
|
|
|
|
|
// viteCompression({
|
|
|
|
|
// verbose: false
|
|
|
|
|
// }),
|
|
|
|
|
uniReadPagesV3Plugin({
|
|
|
|
|
pagesJsonDir: path.resolve(__dirname, './pages.json'),
|
|
|
|
|
includes: ['path', 'aliasPath', 'name', 'meta'],
|
|
|
|
|
}),
|
|
|
|
|
mpliveMainfestPlugin(env.SHOPRO_MPLIVE_ON)
|
|
|
|
|
],
|
|
|
|
|
server: {
|
|
|
|
|
host: true,
|
|
|
|
|
// open: true,
|
|
|
|
|
port: env.SHOPRO_DEV_PORT,
|
|
|
|
|
hmr: {
|
|
|
|
|
overlay: true,
|
|
|
|
|
},
|
2026-02-06 00:44:50 +08:00
|
|
|
proxy: {
|
2026-02-06 14:32:50 +08:00
|
|
|
'/app-api': {
|
|
|
|
|
target: 'http://localhost:48080/',
|
2026-02-06 00:44:50 +08:00
|
|
|
//target: 'http://62.234.3.186/',
|
|
|
|
|
ws: false,
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
2026-02-06 14:32:50 +08:00
|
|
|
'/saasimages/': {
|
|
|
|
|
target: 'http://62.234.3.186/saasimages/',
|
|
|
|
|
ws: false,
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
}
|
2026-02-06 00:44:50 +08:00
|
|
|
}
|
2026-02-04 17:47:51 +08:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|