File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -229,9 +229,12 @@ export default async function (eleventyConfig) {
229
229
// eleventyConfig.addPlugin(formatCodePlugin());
230
230
// }
231
231
232
- let assetsDir = path . join ( process . env . BASE_DIR || 'docs' , 'assets' ) ;
233
- const siteAssetsDir = path . join ( eleventyConfig . directories . output , 'assets' ) ;
234
- fs . cpSync ( assetsDir , siteAssetsDir , { recursive : true } ) ;
232
+ // This needs to happen in "eleventy.after" otherwise incremental builds never update.
233
+ eleventyConfig . on ( 'eleventy.after' , function ( ) {
234
+ let assetsDir = path . join ( process . env . BASE_DIR || 'docs' , 'assets' ) ;
235
+ const siteAssetsDir = path . join ( eleventyConfig . directories . output , 'assets' ) ;
236
+ fs . cpSync ( assetsDir , siteAssetsDir , { recursive : true } ) ;
237
+ } ) ;
235
238
236
239
for ( let glob of passThrough ) {
237
240
eleventyConfig . addPassthroughCopy ( glob ) ;
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ export async function build(options = {}) {
398
398
return async filename => {
399
399
const changedFile = relative ( getRootDir ( ) , filename ) ;
400
400
401
- if ( evt === 'changed ' ) {
401
+ if ( evt === 'change ' ) {
402
402
spinner . info ( `File modified ${ chalk . gray ( `(${ changedFile } )` ) } ` ) ;
403
403
} else if ( evt === 'unlink' ) {
404
404
spinner . info ( `File deleted ${ chalk . gray ( `(${ changedFile } )` ) } ` ) ;
@@ -470,7 +470,7 @@ export async function build(options = {}) {
470
470
}
471
471
await generateDocs ( { spinner } ) ;
472
472
473
- if ( typeof options . beforeWatchEvent === 'function' ) {
473
+ if ( typeof options . afterWatchEvent === 'function' ) {
474
474
await options . afterWatchEvent ( evt , filename ) ;
475
475
}
476
476
reload ( ) ;
You can’t perform that action at this time.
0 commit comments