36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
|
import uni from '@dcloudio/vite-plugin-uni'
|
||
|
import path from 'path'
|
||
|
import { loadEnv } from 'vite'
|
||
|
import uniReadPagesV3Plugin from './peach/router/utils/uni-read-pages-v3'
|
||
|
import uniGetAllIcons from './peach/utils/uni-get-all-icons'
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
|
||
|
export default (command, mode) => {
|
||
|
const env = loadEnv(mode, __dirname, 'MALL_')
|
||
|
|
||
|
return {
|
||
|
envPrefix: 'MALL_',
|
||
|
plugins: [
|
||
|
uni(),
|
||
|
uniReadPagesV3Plugin({
|
||
|
pagesJsonDir: path.resolve(__dirname, './pages.json'),
|
||
|
includes: ['path', 'aliasPath', 'name', 'meta'],
|
||
|
}),
|
||
|
uniGetAllIcons({
|
||
|
scssFilePath: [
|
||
|
path.resolve(__dirname, './peach/scss/icon/_coloricon.scss'),
|
||
|
path.resolve(__dirname, './peach/scss/icon/_icon.scss'),
|
||
|
path.resolve(__dirname, './peach/scss/icon/_sheepicon.scss'),
|
||
|
],
|
||
|
}),
|
||
|
],
|
||
|
server: {
|
||
|
host: '0.0.0.0',
|
||
|
hmr: {
|
||
|
enabled: true,
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
}
|