Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function (source, map) {
const isProd = process.env.NODE_ENV === 'production'
if (!isProd) {
const file = this.resourcePath
// frontmatter changed... need to do a full reload
const cached = cache.get(file)
const parsed = parseStrippedFrontmatter(source)
if (cached &&
cached.data &&
parsed &&
parsed.data &&
JSON.stringify(cached.data) !== JSON.stringify(parsed.data)
) {
frontmatterEmitter.emit('update')
}
cache.set(file, parsed)
}
this.callback(null, '', map)
}