mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2026-01-07 23:46:57 +08:00
feat: 添加pnpm版本信息
This commit is contained in:
parent
b523860052
commit
58addfde56
@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @name ConfigAutoComponentsPlugin
|
* @name ConfigAutoComponentsPlugin
|
||||||
* @description 按需加载,自动引入组件
|
* @description 按需加载,自动引入组件
|
||||||
|
* @returns {import('vite').Plugin} Vite插件配置
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Components from 'unplugin-vue-components/vite';
|
import Components from 'unplugin-vue-components/vite';
|
||||||
@ -11,7 +12,7 @@ import { VantResolver } from '@vant/auto-import-resolver';
|
|||||||
|
|
||||||
export const ConfigAutoComponentsPlugin = () => {
|
export const ConfigAutoComponentsPlugin = () => {
|
||||||
return Components({
|
return Components({
|
||||||
// dirs: ['src/components'],
|
dirs: ['src/components'],
|
||||||
extensions: ['vue', 'md'],
|
extensions: ['vue', 'md'],
|
||||||
deep: true,
|
deep: true,
|
||||||
dts: 'types/components.d.ts',
|
dts: 'types/components.d.ts',
|
||||||
@ -20,6 +21,6 @@ export const ConfigAutoComponentsPlugin = () => {
|
|||||||
directives: true,
|
directives: true,
|
||||||
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
||||||
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
||||||
resolvers: [VueUseComponentsResolver(), VantResolver(), VarletImportResolver(), NutUIResolver()],
|
resolvers: [VueUseComponentsResolver(), VantResolver(), VarletImportResolver(), NutUIResolver({ importStyle: 'sass' })],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -141,6 +141,7 @@
|
|||||||
"prettier --write"
|
"prettier --write"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"packageManager": "pnpm@10.26.2",
|
||||||
"config": {
|
"config": {
|
||||||
"commitizen": {
|
"commitizen": {
|
||||||
"path": "node_modules/cz-git"
|
"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 { createVitePlugins } from './build/vite/plugins';
|
||||||
import type { ConfigEnv, UserConfig } from 'vite';
|
import type { ConfigEnv, UserConfig } from 'vite';
|
||||||
import { loadEnv } from 'vite';
|
import { loadEnv } from 'vite';
|
||||||
import { wrapperEnv } from './build/utils';
|
import { wrapperEnv } from './build/utils';
|
||||||
import { fileURLToPath, URL } from 'node:url';
|
import { fileURLToPath, URL } from 'node:url';
|
||||||
@ -56,7 +56,10 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
|
|||||||
base: '/',
|
base: '/',
|
||||||
root,
|
root,
|
||||||
resolve: {
|
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: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
@ -76,10 +79,8 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
|
|||||||
css: {
|
css: {
|
||||||
preprocessorOptions: {
|
preprocessorOptions: {
|
||||||
scss: {
|
scss: {
|
||||||
quietDeps: true,
|
|
||||||
silenceDeprecations: ['legacy-js-api'],
|
|
||||||
// 配置 nutui 全局 scss 变量
|
// 配置 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