diff --git a/tools/copy.js b/tools/copy.js index 46107342b..4088c0337 100644 --- a/tools/copy.js +++ b/tools/copy.js @@ -37,10 +37,12 @@ async function copy({ watch } = {}) { const watcher = await new Promise((resolve, reject) => { gaze('src/content/**/*.*', (err, val) => err ? reject(err) : resolve(val)); }); - watcher.on('changed', async (file) => { + const cp = async (file) => { const relPath = file.substr(path.join(__dirname, '../src/content/').length); await ncp(`src/content/${relPath}`, `build/content/${relPath}`); - }); + } + watcher.on('changed', cp); + watcher.on('added', cp); } }