@@ -44,10 +44,12 @@ function getDemoID(filename) {
44
44
return names . map ( name => name . charAt ( 0 ) . toUpperCase ( ) + name . slice ( 1 ) ) . join ( '' ) ;
45
45
}
46
46
47
- function extractDemos ( demosPath , i18n ) {
47
+ function extractDemos ( demosPath , i18n , ctx ) {
48
48
var styles = [ ] ;
49
49
var demos = fs . readdirSync ( demosPath + '/demos' ) . map ( filename => {
50
- var demoAST = markdownParser . parse ( fs . readFileSync ( demosPath + '/demos/' + filename , { encoding : 'utf-8' } ) ) ,
50
+ var filePath = demosPath + '/demos/' + filename ;
51
+ ctx . addDependency ( filePath )
52
+ var demoAST = markdownParser . parse ( fs . readFileSync ( filePath , { encoding : 'utf-8' } ) ) ,
51
53
yaml ;
52
54
removePosition ( demoAST , true ) ;
53
55
@@ -129,13 +131,12 @@ module.exports = function transformer(tree, ctx) {
129
131
numberOfTopLevelNodes = nodes . length ,
130
132
path = ctx . context ,
131
133
i18n = extractI18N ( ctx . resourcePath ) ;
132
- ctx . addContextDependency ( path + '/demos' ) ;
133
134
134
135
while ( i < numberOfTopLevelNodes ) {
135
136
if ( isAPIHeader ( nodes [ i ] ) && dirExists ( path + '/demos' ) ) {
136
137
saveRoot ( contentRoot ) ;
137
138
contentRoot = undefined ;
138
- var demos = extractDemos ( path , i18n ) ;
139
+ var demos = extractDemos ( path , i18n , ctx ) ;
139
140
demos . forEach ( function ( demo ) {
140
141
addDemo ( demo ) ;
141
142
0 commit comments