Skip to content

Commit da403fd

Browse files
committed
Underscored Patterns are being built on the UI if styleguide excludes was missing or empty
closes #300
1 parent 69b7fdc commit da403fd

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

core/lib/patternlab.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* patternlab-node - v1.2.1 - 2016
3-
*
1+
/*
2+
* patternlab-node - v1.2.1 - 2016
3+
*
44
* Brian Muenzenmeyer, and the web community.
5-
* Licensed under the MIT license.
6-
*
7-
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
5+
* Licensed under the MIT license.
6+
*
7+
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice.
88
*
99
*/
1010

@@ -281,7 +281,16 @@ var patternlab_engine = function (config) {
281281
}
282282
}
283283
} else {
284-
styleguidePatterns = patternlab.patterns;
284+
for (i = 0; i < patternlab.patterns.length; i++) {
285+
// skip underscore-prefixed files
286+
if (isPatternExcluded(patternlab.patterns[i])) {
287+
if (patternlab.config.debug) {
288+
console.log('Omitting ' + patternlab.patterns[i].key + " from styleguide pattern exclusion.");
289+
}
290+
continue;
291+
}
292+
styleguidePatterns.push(patternlab.patterns[i]);
293+
}
285294
}
286295

287296
//also add the cachebuster value. slight chance this could collide with a user that has defined cacheBuster as a value

0 commit comments

Comments
 (0)