mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-14 06:33:47 +08:00
smart-app alpha 版本
This commit is contained in:
37
smart-app/vite.config.js
Normal file
37
smart-app/vite.config.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { resolve } from 'path';
|
||||
import { defineConfig } from 'vite'
|
||||
import uni from '@dcloudio/vite-plugin-uni'
|
||||
|
||||
const pathResolve = (dir) => {
|
||||
return resolve(__dirname, '.', dir);
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
transpileDependencies:['@dcloudio/uni-ui'],
|
||||
plugins: [
|
||||
uni(),
|
||||
],
|
||||
root: process.cwd(),
|
||||
resolve: {
|
||||
alias: [
|
||||
// 绝对路径重命名:/@/xxxx => src/xxxx
|
||||
{
|
||||
find: /\/@\//,
|
||||
replacement: pathResolve('src') + '/',
|
||||
},
|
||||
{
|
||||
find: /^~/,
|
||||
replacement: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
// 发布时删除console
|
||||
build: {
|
||||
minify: 'terser',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user