feat: 更新依赖,解决启动报错
This commit is contained in:
51
package.json
51
package.json
@@ -17,70 +17,71 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tweenjs/tween.js": "^23.1.2",
|
"@tweenjs/tween.js": "^23.1.2",
|
||||||
"@vueuse/core": "^11.3.0",
|
"@vueuse/core": "^13.9.0",
|
||||||
"axios": "^1.7.8",
|
"axios": "^1.7.8",
|
||||||
"canvas-confetti": "^1.9.3",
|
"canvas-confetti": "^1.9.3",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"github-markdown-css": "^5.8.0",
|
"github-markdown-css": "^5.8.0",
|
||||||
"localforage": "^1.10.0",
|
"localforage": "^1.10.0",
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
"pinia": "^2.2.6",
|
"pinia": "^3.0.3",
|
||||||
"pinia-plugin-persist": "^1.0.0",
|
"pinia-plugin-persist": "^1.0.0",
|
||||||
"sparticles": "^1.3.1",
|
"sparticles": "^1.3.1",
|
||||||
"three": "^0.166.0",
|
"three": "^0.166.0",
|
||||||
"three-css3d": "^1.0.6",
|
"three-css3d": "^1.0.6",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-dompurify-html": "^5.2.0",
|
"vue-dompurify-html": "^5.2.0",
|
||||||
"vue-i18n": "^10.0.4",
|
"vue-i18n": "^11.1.12",
|
||||||
"vue-router": "^4.5.0",
|
"vue-router": "^4.5.0",
|
||||||
"vue-toast-notification": "^3",
|
"vue-toast-notification": "^3",
|
||||||
"vue3-colorpicker": "^2.3.0",
|
"vue3-colorpicker": "^2.3.0",
|
||||||
"xlsx": "^0.18.5",
|
"xlsx": "^0.18.5",
|
||||||
"zod": "^3.23.8"
|
"zod": "^4.1.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^3.9.2",
|
"@antfu/eslint-config": "^5.4.1",
|
||||||
"@eslint/eslintrc": "^3.2.0",
|
"@eslint/eslintrc": "^3.2.0",
|
||||||
"@eslint/js": "^9.15.0",
|
"@eslint/js": "^9.15.0",
|
||||||
"@iconify-json/ep": "^1.2.1",
|
"@iconify-json/ep": "^1.2.1",
|
||||||
"@iconify-json/fluent": "^1.2.8",
|
"@iconify-json/fluent": "^1.2.8",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.15",
|
||||||
|
"@tailwindcss/vite": "^4.1.13",
|
||||||
"@testing-library/vue": "^8.1.0",
|
"@testing-library/vue": "^8.1.0",
|
||||||
"@types/canvas-confetti": "^1.6.4",
|
"@types/canvas-confetti": "^1.6.4",
|
||||||
"@types/markdown-it": "^14.1.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"@types/node": "^22.9.4",
|
"@types/node": "^24.5.2",
|
||||||
"@types/three": "^0.166.0",
|
"@types/three": "^0.166.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
||||||
"@typescript-eslint/parser": "^8.16.0",
|
"@typescript-eslint/parser": "^8.16.0",
|
||||||
"@vitejs/plugin-legacy": "^6.0.0",
|
"@vitejs/plugin-legacy": "^7.2.1",
|
||||||
"@vitejs/plugin-vue": "^5.2.0",
|
"@vitejs/plugin-vue": "^6.0.1",
|
||||||
"@vitest/ui": "^2.1.5",
|
"@vitest/ui": "^3.2.4",
|
||||||
"@vue/test-utils": "^2.4.6",
|
"@vue/test-utils": "^2.4.6",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"daisyui": "^4.12.14",
|
"daisyui": "^5.1.13",
|
||||||
"eslint": "^9.15.0",
|
"eslint": "^9.15.0",
|
||||||
"eslint-plugin-vue": "^9.31.0",
|
"eslint-plugin-vue": "^10.4.0",
|
||||||
"globals": "^15.12.0",
|
"globals": "^16.4.0",
|
||||||
"happy-dom": "^15.11.6",
|
"happy-dom": "^18.0.1",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jsdom": "^25.0.1",
|
"jsdom": "^27.0.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^6.0.3",
|
||||||
"sass": "^1.81.0",
|
"sass": "^1.81.0",
|
||||||
"sass-loader": "^16.0.3",
|
"sass-loader": "^16.0.3",
|
||||||
"tailwindcss": "^3.4.15",
|
"tailwindcss": "^4.1.13",
|
||||||
"terser": "^5.36.0",
|
"terser": "^5.36.0",
|
||||||
"typescript": "5.5.3",
|
"typescript": "5.5.3",
|
||||||
"unplugin-auto-import": "^0.18.5",
|
"unplugin-auto-import": "^20.1.0",
|
||||||
"unplugin-icons": "^0.20.1",
|
"unplugin-icons": "^22.3.0",
|
||||||
"unplugin-vue-components": "^0.27.4",
|
"unplugin-vue-components": "^29.1.0",
|
||||||
"vite": "^5.4.11",
|
"vite": "^7.1.6",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-inspect": "^0.8.8",
|
"vite-plugin-inspect": "^11.3.3",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vite-plugin-vue-devtools": "^7.6.4",
|
"vite-plugin-vue-devtools": "^8.0.2",
|
||||||
"vitest": "^2.1.5",
|
"vitest": "^3.2.4",
|
||||||
"vue-tsc": "^2.1.10"
|
"vue-tsc": "^3.0.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
5888
pnpm-lock.yaml
generated
5888
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@@ -2,6 +2,7 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
|
// biome-ignore lint: disable
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
|
|||||||
38
src/constant/theme.ts
Normal file
38
src/constant/theme.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
export const daisyuiThemes = [
|
||||||
|
'valentine',
|
||||||
|
'halloween',
|
||||||
|
'cmyk',
|
||||||
|
'winter',
|
||||||
|
'corporate',
|
||||||
|
'fantasy',
|
||||||
|
'aqua',
|
||||||
|
'pastel',
|
||||||
|
'lemonade',
|
||||||
|
'garden',
|
||||||
|
'silk',
|
||||||
|
'black',
|
||||||
|
'coffee',
|
||||||
|
'wireframe',
|
||||||
|
'caramellatte',
|
||||||
|
'acid',
|
||||||
|
'cyberpunk',
|
||||||
|
'nord',
|
||||||
|
'bumblebee',
|
||||||
|
'night',
|
||||||
|
'dracula',
|
||||||
|
'synthwave',
|
||||||
|
'light',
|
||||||
|
'dark',
|
||||||
|
'forest',
|
||||||
|
'emerald',
|
||||||
|
'business',
|
||||||
|
'cupcake',
|
||||||
|
'autumn',
|
||||||
|
'abyss',
|
||||||
|
'dim',
|
||||||
|
'lofi',
|
||||||
|
'sunset',
|
||||||
|
'luxury',
|
||||||
|
'retro',
|
||||||
|
|
||||||
|
]
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
@tailwind base;
|
@import "tailwindcss";
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
@plugin "daisyui" {
|
||||||
|
themes: all;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @plugin "@tailwindcss/typography" */
|
||||||
|
|
||||||
body,
|
body,
|
||||||
html {
|
html {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import i18n, { languageList } from '@/locales/i18n'
|
import { daisyuiThemes } from '@/constant/theme'
|
||||||
|
|
||||||
|
import i18n, { languageList } from '@/locales/i18n'
|
||||||
import useStore from '@/store'
|
import useStore from '@/store'
|
||||||
import { themeChange } from '@/utils'
|
import { themeChange } from '@/utils'
|
||||||
import { isHex, isRgbOrRgba } from '@/utils/color'
|
import { isHex, isRgbOrRgba } from '@/utils/color'
|
||||||
import daisyuiThemes from 'daisyui/src/theming/themes'
|
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { onMounted, ref, watch } from 'vue'
|
import { onMounted, ref, watch } from 'vue'
|
||||||
import { ColorPicker } from 'vue3-colorpicker'
|
import { ColorPicker } from 'vue3-colorpicker'
|
||||||
@@ -17,7 +17,7 @@ const { t } = useI18n()
|
|||||||
const globalConfig = useStore().globalConfig
|
const globalConfig = useStore().globalConfig
|
||||||
const personConfig = useStore().personConfig
|
const personConfig = useStore().personConfig
|
||||||
const prizeConfig = useStore().prizeConfig
|
const prizeConfig = useStore().prizeConfig
|
||||||
const { getTopTitle: topTitle, getTheme: localTheme, getPatterColor: patternColor, getPatternList: patternList, getCardColor: cardColor, getLuckyColor: luckyCardColor, getTextColor: textColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getIsShowPrizeList: isShowPrizeList, getLanguage: userLanguage, getBackground: backgroundImage, getImageList: imageList, getIsShowAvatar: isShowAvatar
|
const { getTopTitle: topTitle, getTheme: localTheme, getPatterColor: patternColor, getPatternList: patternList, getCardColor: cardColor, getLuckyColor: luckyCardColor, getTextColor: textColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getIsShowPrizeList: isShowPrizeList, getLanguage: userLanguage, getBackground: backgroundImage, getImageList: imageList, getIsShowAvatar: isShowAvatar,
|
||||||
} = storeToRefs(globalConfig)
|
} = storeToRefs(globalConfig)
|
||||||
const { getAlreadyPersonList: alreadyPersonList, getNotPersonList: notPersonList } = storeToRefs(personConfig)
|
const { getAlreadyPersonList: alreadyPersonList, getNotPersonList: notPersonList } = storeToRefs(personConfig)
|
||||||
const colorPickerRef = ref()
|
const colorPickerRef = ref()
|
||||||
@@ -38,7 +38,7 @@ const languageValue = ref(structuredClone(userLanguage.value))
|
|||||||
const isShowPrizeListValue = ref(structuredClone(isShowPrizeList.value))
|
const isShowPrizeListValue = ref(structuredClone(isShowPrizeList.value))
|
||||||
const isShowAvatarValue = ref(structuredClone(isShowAvatar.value))
|
const isShowAvatarValue = ref(structuredClone(isShowAvatar.value))
|
||||||
const patternColorValue = ref(structuredClone(patternColor.value))
|
const patternColorValue = ref(structuredClone(patternColor.value))
|
||||||
const themeList = ref(Object.keys(daisyuiThemes))
|
const themeList = ref(daisyuiThemes)
|
||||||
const daisyuiThemeList = ref<ThemeDaType>(daisyuiThemes)
|
const daisyuiThemeList = ref<ThemeDaType>(daisyuiThemes)
|
||||||
const backgroundImageValue = ref(backgroundImage.value)
|
const backgroundImageValue = ref(backgroundImage.value)
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@@ -49,8 +49,9 @@ const formErr = ref({
|
|||||||
})
|
})
|
||||||
const schema = zod.object({
|
const schema = zod.object({
|
||||||
rowCount: zod.number({
|
rowCount: zod.number({
|
||||||
required_error: i18n.global.t('error.require'),
|
error: i18n.global.t('error.require'),
|
||||||
invalid_type_error: i18n.global.t('error.requireNumber'),
|
// required_error: i18n.global.t('error.require'),
|
||||||
|
// invalid_type_error: i18n.global.t('error.requireNumber'),
|
||||||
})
|
})
|
||||||
.min(1, i18n.global.t('error.minNumber1'))
|
.min(1, i18n.global.t('error.minNumber1'))
|
||||||
.max(100, i18n.global.t('error.maxNumber100')),
|
.max(100, i18n.global.t('error.maxNumber100')),
|
||||||
@@ -158,7 +159,7 @@ watch(languageValue, (val: string) => {
|
|||||||
globalConfig.setLanguage(val)
|
globalConfig.setLanguage(val)
|
||||||
})
|
})
|
||||||
watch(isShowAvatarValue, () => {
|
watch(isShowAvatarValue, () => {
|
||||||
globalConfig.setIsShowAvatar(isShowAvatarValue.value)
|
globalConfig.setIsShowAvatar(isShowAvatarValue.value)
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
})
|
})
|
||||||
@@ -350,11 +351,13 @@ onMounted(() => {
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="w-full max-w-xs mb-10 form-control">
|
<label class="w-full max-w-xs mb-10 form-control">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span class="label-text">{{ t('table.avatarDisplay') }}</span>
|
<span class="label-text">{{ t('table.avatarDisplay') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<input type="checkbox" :checked="isShowAvatarValue" @change="isShowAvatarValue = !isShowAvatarValue"
|
<input
|
||||||
class="mt-2 border-solid checkbox checkbox-secondary border-1" />
|
type="checkbox" :checked="isShowAvatarValue" class="mt-2 border-solid checkbox checkbox-secondary border-1"
|
||||||
|
@change="isShowAvatarValue = !isShowAvatarValue"
|
||||||
|
>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
module.exports = {
|
|
||||||
darkMode: 'class',
|
|
||||||
corePlugins: {
|
|
||||||
preflight: false
|
|
||||||
},
|
|
||||||
theme: {
|
|
||||||
|
|
||||||
},
|
|
||||||
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
|
|
||||||
plugins: [require('@tailwindcss/typography'), require('daisyui')],
|
|
||||||
daisyui: {
|
|
||||||
themes: true, // false: only light + dark | true: all themes | array: specific themes like this ["light", "dark", "cupcake"]
|
|
||||||
darkTheme: '', // name of one of the included themes for dark mode
|
|
||||||
base: true, // applies background color and foreground color for root element by default
|
|
||||||
styled: true, // include daisyUI colors and design decisions for all components
|
|
||||||
utils: true, // adds responsive and modifier utility classes
|
|
||||||
prefix: '', // prefix for daisyUI classnames (components, modifiers and responsive class names. Not colors)
|
|
||||||
logs: true, // Shows info about daisyUI version and used config in the console when building your CSS
|
|
||||||
themeRoot: ':root', // The element that receives theme color CSS variables
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
244
vite.config.ts
244
vite.config.ts
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { createRequire } from 'node:module'
|
import { createRequire } from 'node:module'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
import legacy from '@vitejs/plugin-legacy'
|
import legacy from '@vitejs/plugin-legacy'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import { visualizer } from 'rollup-plugin-visualizer'
|
import { visualizer } from 'rollup-plugin-visualizer'
|
||||||
@@ -19,132 +20,133 @@ const require = createRequire(import.meta.url)
|
|||||||
const process = require('node:process')
|
const process = require('node:process')
|
||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, __dirname)
|
const env = loadEnv(mode, __dirname)
|
||||||
const chunkName = mode === 'prebuild' ? '[name]' : 'chunk'
|
const chunkName = mode === 'prebuild' ? '[name]' : 'chunk'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: mode === 'file' ? './' : '/log-lottery/',
|
base: mode === 'file' ? './' : '/log-lottery/',
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
mode === 'file'
|
tailwindcss(),
|
||||||
? legacy({
|
mode === 'file'
|
||||||
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
|
? legacy({
|
||||||
})
|
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
|
||||||
: null,
|
})
|
||||||
// vueDevTools(),
|
: null,
|
||||||
viteCompression({
|
// vueDevTools(),
|
||||||
verbose: true,
|
viteCompression({
|
||||||
disable: false,
|
verbose: true,
|
||||||
threshold: 10240,
|
disable: false,
|
||||||
algorithm: 'gzip',
|
threshold: 10240,
|
||||||
ext: '.gz',
|
algorithm: 'gzip',
|
||||||
}),
|
ext: '.gz',
|
||||||
visualizer({
|
}),
|
||||||
emitFile: true, // 是否被触摸
|
visualizer({
|
||||||
filename: 'test.html', // 生成分析网页文件名
|
emitFile: true, // 是否被触摸
|
||||||
open: true, // 在默认用户代理中打开生成的文件
|
filename: 'test.html', // 生成分析网页文件名
|
||||||
gzipSize: true, // 从源代码中收集 gzip 大小并将其显示在图表中
|
open: true, // 在默认用户代理中打开生成的文件
|
||||||
brotliSize: true, // 从源代码中收集 brotli 大小并将其显示在图表中
|
gzipSize: true, // 从源代码中收集 gzip 大小并将其显示在图表中
|
||||||
}),
|
brotliSize: true, // 从源代码中收集 brotli 大小并将其显示在图表中
|
||||||
|
}),
|
||||||
|
|
||||||
createSvgIconsPlugin({
|
createSvgIconsPlugin({
|
||||||
// 指定需要缓存的图标文件夹
|
// 指定需要缓存的图标文件夹
|
||||||
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
|
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
|
||||||
// 指定symbolId格式
|
// 指定symbolId格式
|
||||||
symbolId: 'icon-[dir]-[name]',
|
symbolId: 'icon-[dir]-[name]',
|
||||||
}),
|
}),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
resolvers: [
|
resolvers: [
|
||||||
// 自动导入图标组件
|
// 自动导入图标组件
|
||||||
IconsResolver({
|
IconsResolver({
|
||||||
prefix: 'Icon',
|
prefix: 'Icon',
|
||||||
}),
|
}),
|
||||||
|
],
|
||||||
|
dts: path.resolve(path.resolve(__dirname, 'src'), 'auto-imports.d.ts'),
|
||||||
|
}),
|
||||||
|
Components({
|
||||||
|
resolvers: [
|
||||||
|
// 自动注册图标组件
|
||||||
|
IconsResolver({
|
||||||
|
enabledCollections: ['ep'],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
dts: path.resolve(path.resolve(__dirname, 'src'), 'components.d.ts'),
|
||||||
|
}),
|
||||||
|
Icons({
|
||||||
|
autoInstall: true,
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
dts: path.resolve(path.resolve(__dirname, 'src'), 'auto-imports.d.ts'),
|
css: {
|
||||||
}),
|
preprocessorOptions: {
|
||||||
Components({
|
scss: {
|
||||||
resolvers: [
|
additionalData: '@use "@/style/global.scss" as *;',
|
||||||
// 自动注册图标组件
|
},
|
||||||
IconsResolver({
|
},
|
||||||
enabledCollections: ['ep'],
|
// postcss: {
|
||||||
}),
|
// plugins: [
|
||||||
],
|
// require('tailwindcss'),
|
||||||
dts: path.resolve(path.resolve(__dirname, 'src'), 'components.d.ts'),
|
// require('autoprefixer'),
|
||||||
}),
|
// ]
|
||||||
Icons({
|
// }
|
||||||
autoInstall: true,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
css: {
|
|
||||||
preprocessorOptions: {
|
|
||||||
scss: {
|
|
||||||
additionalData: '@use "@/style/global.scss" as *;',
|
|
||||||
},
|
},
|
||||||
},
|
server: {
|
||||||
// postcss: {
|
host: 'localhost',
|
||||||
// plugins: [
|
port: 6719,
|
||||||
// require('tailwindcss'),
|
proxy: {
|
||||||
// require('autoprefixer'),
|
'/api': {
|
||||||
// ]
|
target: env.VITE_BASE_URL,
|
||||||
// }
|
// 是否跨域
|
||||||
},
|
changeOrigin: true,
|
||||||
server: {
|
// 路径重写
|
||||||
host: 'localhost',
|
rewrite: path => path.replace(/^\/api/, ''),
|
||||||
port: 6719,
|
},
|
||||||
proxy: {
|
},
|
||||||
'/api': {
|
|
||||||
target: env.VITE_BASE_URL,
|
|
||||||
// 是否跨域
|
|
||||||
changeOrigin: true,
|
|
||||||
// 路径重写
|
|
||||||
rewrite: path => path.replace(/^\/api/, ''),
|
|
||||||
},
|
},
|
||||||
},
|
resolve: {
|
||||||
},
|
alias: {
|
||||||
resolve: {
|
'@': path.resolve(__dirname, './src'),
|
||||||
alias: {
|
},
|
||||||
'@': path.resolve(__dirname, './src'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
build: {
|
|
||||||
minify: 'terser',
|
|
||||||
terserOptions: {
|
|
||||||
compress: {
|
|
||||||
// 生产环境时移除console
|
|
||||||
drop_console: true,
|
|
||||||
drop_debugger: true,
|
|
||||||
},
|
},
|
||||||
},
|
build: {
|
||||||
// 关闭文件计算
|
minify: 'terser',
|
||||||
reportCompressedSize: false,
|
terserOptions: {
|
||||||
// 关闭生成map文件 可以达到缩小打包体积
|
compress: {
|
||||||
sourcemap: false, // 这个生产环境一定要关闭,不然打包的产物会很大
|
// 生产环境时移除console
|
||||||
rollupOptions: {
|
drop_console: true,
|
||||||
output: {
|
drop_debugger: true,
|
||||||
chunkFileNames: `js/${chunkName}-[hash].js`, // 引入文件名的名称
|
},
|
||||||
entryFileNames: `js/${chunkName}-[hash].js`, // 包的入口文件名称
|
},
|
||||||
assetFileNames: `[ext]/${chunkName}-[hash].[ext]`, // 资源文件像 字体,图片等
|
// 关闭文件计算
|
||||||
manualChunks(id: any): string {
|
reportCompressedSize: false,
|
||||||
if (id.includes('node_modules')) {
|
// 关闭生成map文件 可以达到缩小打包体积
|
||||||
return id
|
sourcemap: false, // 这个生产环境一定要关闭,不然打包的产物会很大
|
||||||
.toString()
|
rollupOptions: {
|
||||||
.split('node_modules/')[1]
|
output: {
|
||||||
.split('/')[0]
|
chunkFileNames: `js/${chunkName}-[hash].js`, // 引入文件名的名称
|
||||||
.toString()
|
entryFileNames: `js/${chunkName}-[hash].js`, // 包的入口文件名称
|
||||||
}
|
assetFileNames: `[ext]/${chunkName}-[hash].[ext]`, // 资源文件像 字体,图片等
|
||||||
},
|
manualChunks(id: any): string {
|
||||||
|
if (id.includes('node_modules')) {
|
||||||
|
return id
|
||||||
|
.toString()
|
||||||
|
.split('node_modules/')[1]
|
||||||
|
.split('/')[0]
|
||||||
|
.toString()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
// 使用这个必须在上面加/// <reference types="vitest" /> 不然会有类型报错
|
||||||
},
|
test: {
|
||||||
// 使用这个必须在上面加/// <reference types="vitest" /> 不然会有类型报错
|
globals: true, // --> 0.8.1+ 请修改成globals
|
||||||
test: {
|
environment: 'jsdom',
|
||||||
globals: true, // --> 0.8.1+ 请修改成globals
|
// include: ['**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||||
environment: 'jsdom',
|
// passWithNoTests: true,
|
||||||
// include: ['**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
transformMode: {
|
||||||
// passWithNoTests: true,
|
web: [/\.[jt]sx$/],
|
||||||
transformMode: {
|
},
|
||||||
web: [/\.[jt]sx$/],
|
},
|
||||||
},
|
}
|
||||||
},
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user