mall-uniapp/vite.config.js

35 lines
856 B
JavaScript
Raw Normal View History

2022-11-22 07:45:36 +00: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';
2023-03-29 08:26:54 +00:00
import mpliveMainfestPlugin from './sheep/libs/mplive-manifest-plugin';
2023-03-18 01:26:37 +00:00
2022-11-22 07:45:36 +00:00
// https://vitejs.dev/config/
export default (command, mode) => {
const env = loadEnv(mode, __dirname, 'SHOPRO_');
return {
envPrefix: "SHOPRO_",
plugins: [
uni(),
// viteCompression({
// verbose: false
// }),
uniReadPagesV3Plugin({
pagesJsonDir: path.resolve(__dirname, './pages.json'),
includes: ['path', 'aliasPath', 'name', 'meta'],
}),
2023-03-20 06:35:31 +00:00
mpliveMainfestPlugin(env.SHOPRO_MPLIVE_ON)
2022-11-22 07:45:36 +00:00
],
server: {
host: true,
// open: true,
port: env.SHOPRO_DEV_PORT,
hmr: {
overlay: true,
},
},
};
};