File size: 355 Bytes
1e92f2d
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
module.exports = function(source, map) {
  this.cacheable()
  const fileName = this.resourcePath.slice(this.resourcePath.lastIndexOf('/') + 1)
  const prefix = `import withNextraLayout from '.nextra/layout'\n\n`
  const suffix = `\n\nexport default withNextraLayout("${fileName}")`
  source = prefix + source + suffix
  this.callback(null, source, map)
}