mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2026-01-06 14:56:57 +08:00
feat: 添加pnpm版本信息
This commit is contained in:
parent
b523860052
commit
58addfde56
@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @name ConfigAutoComponentsPlugin
|
||||
* @name ConfigAutoComponentsPlugin
|
||||
* @description 按需加载,自动引入组件
|
||||
* @returns {import('vite').Plugin} Vite插件配置
|
||||
*/
|
||||
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
@ -11,7 +12,7 @@ import { VantResolver } from '@vant/auto-import-resolver';
|
||||
|
||||
export const ConfigAutoComponentsPlugin = () => {
|
||||
return Components({
|
||||
// dirs: ['src/components'],
|
||||
dirs: ['src/components'],
|
||||
extensions: ['vue', 'md'],
|
||||
deep: true,
|
||||
dts: 'types/components.d.ts',
|
||||
@ -20,6 +21,6 @@ export const ConfigAutoComponentsPlugin = () => {
|
||||
directives: true,
|
||||
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
||||
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
||||
resolvers: [VueUseComponentsResolver(), VantResolver(), VarletImportResolver(), NutUIResolver()],
|
||||
resolvers: [VueUseComponentsResolver(), VantResolver(), VarletImportResolver(), NutUIResolver({ importStyle: 'sass' })],
|
||||
});
|
||||
};
|
||||
|
||||
@ -141,6 +141,7 @@
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"packageManager": "pnpm@10.26.2",
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "node_modules/cz-git"
|
||||
|
||||
2
src/styles/varible.scss
Normal file
2
src/styles/varible.scss
Normal file
@ -0,0 +1,2 @@
|
||||
$primary-color: green;
|
||||
$primary-color-end: #496af2;
|
||||
@ -1,5 +1,5 @@
|
||||
import { createVitePlugins } from './build/vite/plugins';
|
||||
import type { ConfigEnv, UserConfig } from 'vite';
|
||||
import type { ConfigEnv, UserConfig } from 'vite';
|
||||
import { loadEnv } from 'vite';
|
||||
import { wrapperEnv } from './build/utils';
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
@ -56,7 +56,10 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
|
||||
base: '/',
|
||||
root,
|
||||
resolve: {
|
||||
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), '#': fileURLToPath(new URL('./types', import.meta.url)) },
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
'#': fileURLToPath(new URL('./types', import.meta.url))
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: true,
|
||||
@ -76,10 +79,8 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
quietDeps: true,
|
||||
silenceDeprecations: ['legacy-js-api'],
|
||||
// 配置 nutui 全局 scss 变量
|
||||
additionalData: `@use "@nutui/nutui/dist/styles/variables.scss" as *; @use '@/styles/vant.scss' as *;`,
|
||||
additionalData: `@import "@/styles/varible.scss";@import "@nutui/nutui/dist/styles/variables-jdt.scss";`
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user