fix: do not exclude node_modules components

This commit is contained in:
YunYouJun 2024-12-18 03:52:19 +08:00
parent 55717ff3ee
commit b26c6487c6
5 changed files with 10 additions and 5 deletions

View File

@ -37,9 +37,12 @@ This also means that you can cover one component of the theme to achieve customi
import { defineValaxyConfig } from 'valaxy'
export default defineValaxyConfig({
// @see https://github.com/unplugin/unplugin-vue-components#configuration
/**
* @see https://github.com/unplugin/unplugin-vue-components#configuration
* `/[\\/]node_modules[\\/]/, ` 不要排除 node_modules/valaxy/client/components 下的组件
*/
components: {
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.exclude[\\/]/],
exclude: [/[\\/]\.git[\\/]/, /[\\/]\.exclude[\\/]/],
},
})
```

View File

@ -55,6 +55,7 @@
"e2e": "playwright test",
"e2e:ui": "playwright test --ui",
"e2e:report": "playwright show-report",
"link:dev": "pnpm -C packages/valaxy link --global",
"lint": "eslint .",
"stylelint": "stylelint --fix \"**/*.{scss,vue}\"",
"preinstall": "npx only-allow pnpm",

View File

@ -40,7 +40,7 @@ export function injectPageDataCode(pageData: PageData) {
}
export function createTransformMarkdown(options: ResolvedValaxyOptions) {
const loaderVuePath = path.resolve(options.clientRoot, 'templates/loader.vue')
const loaderVuePath = path.resolve(options.clientRoot, 'templates', 'loader.vue')
const loaderVue = fs.readFileSync(loaderVuePath, 'utf-8')
return (code: string, id: string, pageData: PageData) => {

View File

@ -74,8 +74,9 @@ export async function ViteValaxyPlugins(
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
/**
* components/.exclude
* `/[\\/]node_modules[\\/]/, ` node_modules/valaxy/client/components
*/
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.exclude[\\/]/],
exclude: [/[\\/]\.git[\\/]/, /[\\/]\.exclude[\\/]/],
// allow override
allowOverrides: true,

View File

@ -1,7 +1,7 @@
{
"name": "valaxy",
"type": "module",
"version": "0.22.1",
"version": "0.22.2-beta.5",
"description": "📄 Vite & Vue powered static blog generator.",
"author": {
"email": "me@yunyoujun.cn",