mirror of
https://gitee.com/h_mo/uniapp-vue3-vite-ts-template
synced 2025-11-10 02:02:09 +08:00
build(deps): 更新项目依赖版本
This commit is contained in:
parent
d33a9aad0f
commit
7f88a127a7
@ -1,7 +1,7 @@
|
||||
import type { PluginOption } from 'vite';
|
||||
import uni from '@dcloudio/vite-plugin-uni';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import Unocss from 'unocss/vite';
|
||||
import autoImport from 'unplugin-auto-import/vite';
|
||||
import viteRestart from 'vite-plugin-restart';
|
||||
import { isH5 } from './platform';
|
||||
@ -14,9 +14,7 @@ export function createVitePlugins({ isProd }: VitePluginConfig): PluginOption[]
|
||||
return [
|
||||
// @ts-expect-error TODO uni() 会报错:uni is not a function,暂时使用此方式解决
|
||||
uni?.default(),
|
||||
Unocss({
|
||||
hmrTopLevelAwait: false,
|
||||
}),
|
||||
tailwindcss(),
|
||||
autoImport({
|
||||
include: [
|
||||
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
||||
|
||||
72
package.json
72
package.json
@ -45,59 +45,59 @@
|
||||
"@alova/adapter-uniapp": "^2.0.14",
|
||||
"@alova/mock": "^2.0.17",
|
||||
"@alova/shared": "^1.3.1",
|
||||
"@dcloudio/uni-app": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-components": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-h5": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-i18n": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-lark": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-qq": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-app": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-components": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-h5": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-i18n": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-alipay": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-baidu": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-lark": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-qq": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4080220250929001",
|
||||
"@multiavatar/multiavatar": "^1.0.7",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"alova": "^3.3.4",
|
||||
"crypto-js": "^4.2.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"pinia": "^3.0.3",
|
||||
"vue": "^3.5.18"
|
||||
"tailwindcss": "^4.1.14",
|
||||
"vue": "^3.5.22"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.1.0",
|
||||
"@dcloudio/types": "^3.4.19",
|
||||
"@dcloudio/uni-automator": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/uni-uts-v1": "3.0.0-alpha-4070720250804001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-4070720250804001",
|
||||
"@iconify/json": "^2.2.366",
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
"@dcloudio/types": "^3.4.22",
|
||||
"@dcloudio/uni-automator": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/uni-uts-v1": "3.0.0-alpha-4080220250929001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-4080220250929001",
|
||||
"@iconify/json": "^2.2.391",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^22.17.0",
|
||||
"@types/node": "^22.18.8",
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"@vue/runtime-core": "^3.5.18",
|
||||
"@vue/runtime-core": "^3.5.22",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"commit-and-tag-version": "^12.5.2",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-plugin-format": "^1.0.1",
|
||||
"globals": "^16.3.0",
|
||||
"commit-and-tag-version": "^12.6.0",
|
||||
"eslint": "^9.37.0",
|
||||
"eslint-plugin-format": "^1.0.2",
|
||||
"globals": "^16.4.0",
|
||||
"lint-staged": "^15.5.2",
|
||||
"picocolors": "^1.1.1",
|
||||
"rollup-plugin-visualizer": "^6.0.3",
|
||||
"sass": "^1.89.2",
|
||||
"rollup-plugin-visualizer": "^6.0.4",
|
||||
"sass": "^1.93.2",
|
||||
"simple-git-hooks": "^2.13.1",
|
||||
"tsx": "^4.20.3",
|
||||
"typescript": "^5.9.2",
|
||||
"tsx": "^4.20.6",
|
||||
"typescript": "^5.9.3",
|
||||
"uni-mini-router": "^0.1.6",
|
||||
"uni-read-pages-vite": "^0.0.6",
|
||||
"unocss": "66.4.1",
|
||||
"unocss-preset-weapp": "^66.0.2",
|
||||
"unplugin-auto-import": "^20.0.0",
|
||||
"vite": "^6.3.5",
|
||||
"unplugin-auto-import": "^20.2.0",
|
||||
"vite": "^7.1.9",
|
||||
"vite-plugin-restart": "^1.0.0"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
|
||||
@ -12,7 +12,7 @@ const msgPath = path.resolve('.git/COMMIT_EDITMSG');
|
||||
const msg = readFileSync(msgPath, 'utf-8').trim();
|
||||
|
||||
const commitRE
|
||||
= /^(?:revert: )?(?:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|mod|release|strengthen)(?:\(.+\))?: .{1,50}/;
|
||||
= /^(?:revert: )?(?:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|mod|release|strengthen)(?:\(.+\))?: .{1,50}/;
|
||||
|
||||
if (!commitRE.test(msg)) {
|
||||
console.log(pico.yellow(`\n提交的信息: ${msg}\n`));
|
||||
|
||||
@ -3,7 +3,6 @@ import App from './App.vue';
|
||||
import { setupRouter } from './router';
|
||||
import { setupStore } from './stores';
|
||||
import './styles/main.css';
|
||||
import 'uno.css';
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
|
||||
@ -8,11 +8,11 @@ const appTitle = 'uniapp-vue3';
|
||||
|
||||
<template>
|
||||
<view class="flex flex-col items-center gap-y-2 pt-36">
|
||||
<image :src="logo" class="h-8 w-8" alt="" mode="widthFix" />
|
||||
<view class="text-xl font-semibold text-red">
|
||||
<image :src="logo" class="size-4" alt="" mode="widthFix" />
|
||||
<view class="text-xl font-semibold text-red-500 text-center">
|
||||
{{ appTitle }}
|
||||
</view>
|
||||
<view class="text-red">
|
||||
<view class="text-red-500 text-center">
|
||||
当前平台:{{ platform }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -0,0 +1 @@
|
||||
@import 'tailwindcss';
|
||||
@ -96,6 +96,6 @@ export const isClient = !isServer;
|
||||
export function isUrl(path: string): boolean {
|
||||
const reg
|
||||
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
||||
= /^(?:https|http|ftp|rtsp|mms):\/\/(?:(?:[\w!~*'().&=+$%-]+: )?[\w!~*'().&=+$%-]+@)?(?:(?:\d{1,3}.){3}\d{1,3}|(?:[\w!~*'()-]+.)*(?:[0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(?::\d{1,4})?(?:\/?|(?:\/[\w!~*'().;?:@&=+$,%#-]+)+\/?)$/;
|
||||
= /^(?:https|http|ftp|rtsp|mms):\/\/(?:(?:[\w!~*'().&=+$%-]+: )?[\w!~*'().&=+$%-]+@)?(?:(?:\d{1,3}.){3}\d{1,3}|(?:[\w!~*'()-]+.)*(?:[0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(?::\d{1,4})?(?:\/?|(?:\/[\w!~*'().;?:@&=+$,%#-]+)+\/?)$/;
|
||||
return reg.test(path);
|
||||
}
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
import { defineConfig, presetIcons } from 'unocss';
|
||||
import presetWeapp from 'unocss-preset-weapp';
|
||||
import { transformerAttributify, transformerClass } from 'unocss-preset-weapp/transformer';
|
||||
import { isWeixinMp } from './build/platform';
|
||||
|
||||
const prefix = '';
|
||||
|
||||
const transformRules = {
|
||||
'.': '-d2e-',
|
||||
'/': '-s2f-',
|
||||
':': '-c3a-',
|
||||
'%': '-p25-',
|
||||
'!': '-e21-',
|
||||
'#': '-w23-',
|
||||
'(': '-b28-',
|
||||
')': '-b29-',
|
||||
'[': '-f4b-',
|
||||
']': '-f5d-',
|
||||
'$': '-r24-',
|
||||
',': '-r2c-',
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
presets: [
|
||||
// https://github.com/MellowCo/unocss-preset-weapp
|
||||
presetWeapp({
|
||||
prefix,
|
||||
whRpx: false,
|
||||
transform: isWeixinMp as boolean,
|
||||
platform: 'uniapp',
|
||||
transformRules,
|
||||
}) as any,
|
||||
presetIcons({
|
||||
scale: 1.2,
|
||||
warn: true,
|
||||
}),
|
||||
],
|
||||
shortcuts: [
|
||||
{
|
||||
center: 'flex justify-center items-center',
|
||||
},
|
||||
],
|
||||
theme: {
|
||||
colors: {
|
||||
primary: '#007AFF',
|
||||
secondary: '#4CD964',
|
||||
danger: '#FF3B30',
|
||||
warning: '#FF9500',
|
||||
info: '#5AC8FA',
|
||||
light: '#F0F0F0',
|
||||
dark: '#1A1A1A',
|
||||
},
|
||||
fontSize: {
|
||||
mini: ['20rpx', '26rpx'],
|
||||
},
|
||||
},
|
||||
transformers: [
|
||||
// options https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerAttributify
|
||||
transformerAttributify({
|
||||
classPrefix: prefix,
|
||||
transformRules,
|
||||
nonValuedAttribute: true,
|
||||
}) as any,
|
||||
// options https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerClass
|
||||
transformerClass({
|
||||
transformRules,
|
||||
}),
|
||||
],
|
||||
});
|
||||
@ -9,7 +9,6 @@ import process from 'node:process';
|
||||
import TransformPages from 'uni-read-pages-vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import { createVitePlugins, currentPlatform, resolveProxy } from './build';
|
||||
// import postcssPlugins from './postcss.config';
|
||||
|
||||
export default defineConfig(async ({ mode }) => {
|
||||
const root = process.cwd();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user