Skip to content

Commit 1f3e4e2

Browse files
eduardcotmrffgiraud
authored and
fgiraud
committedOct 8, 2019
feat($core): config pattern of resolved files (#1705)
* feat($core): config pattern of resolved files Thank's for your work @eduardcotmrf good job fix #1700
1 parent c2ed43d commit 1f3e4e2

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed
 

‎packages/@vuepress/core/lib/node/App.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ module.exports = class App {
316316

317317
async resolvePages () {
318318
// resolve pageFiles
319-
const patterns = ['**/*.md', '**/*.vue', '!.vuepress', '!node_modules']
319+
const patterns = this.siteConfig.patterns ? this.siteConfig.patterns : ['**/*.md', '**/*.vue']
320+
patterns.push('!.vuepress', '!node_modules')
321+
320322
if (this.siteConfig.dest) {
321323
// #654 exclude dest folder when dest dir was set in
322324
// sourceDir but not in '.vuepress'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
title: 'Hello VuePress',
3+
description: '# Hello, VuePress!',
4+
dest: 'vuepress',
5+
base: 'vuepress',
6+
patterns: ['**/*.md', '**/*.vue', '!**/deploy.*'],
7+
head: [
8+
['link', { rel: 'icon', href: '/logo.png' }]
9+
]
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Hello, VuePress!

‎packages/docs/docs/config/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ module.exports = {
131131
}
132132
```
133133

134+
### patterns
135+
136+
- Type: `Array`
137+
- Default: `['**/*.md', '**/*.vue']`
138+
139+
Specify which pattern of files you want to be resolved.
140+
134141
## Styling
135142

136143
### palette.styl

‎packages/docs/docs/zh/config/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ module.exports = {
127127
}
128128
```
129129

130+
### patterns
131+
132+
- Type: `Array`
133+
- Default: `['**/*.md', '**/*.vue']`
134+
135+
Specify which pattern of files you want to be resolved.
136+
130137
## Styling
131138

132139
### palette.styl

0 commit comments

Comments
 (0)
Please sign in to comment.