Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(
ctx.siteConfig.extraWatchFiles || []
).map(file => normalizeWatchFilePath(file, ctx.sourceDir))
)
logger.debug('watchFiles', watchFiles)
// watch config file
const configWatcher = chokidar.watch(watchFiles, {
cwd: sourceDir,
ignoreInitial: true
})
configWatcher.on('change', spawnUpdate('change'))
// also listen for frontmatter changes from markdown files
frontmatterEmitter.on('update', () => update('frontmatter or headers change'))
// resolve webpack config
let config = createClientConfig(ctx)
config
.plugin('html')
// using a fork of html-webpack-plugin to avoid it requiring webpack
// internals from an incompatible version.
.use(require('vuepress-html-webpack-plugin'), [{
template: ctx.devTemplate
}])
config
.plugin('site-data')
.use(HeadPlugin, [{
tags: ctx.siteConfig.head || []
watchFrontmatter () {
frontmatterEmitter.on('update', target => this.handleUpdate('frontmatter', target))
}