mirror of
https://github.com/primer/css.git
synced 2024-12-18 03:31:43 +03:00
13 lines
248 B
JavaScript
13 lines
248 B
JavaScript
const matter = require('gray-matter')
|
|
|
|
module.exports = function frontmatterLoader(src) {
|
|
try {
|
|
const {content, data} = matter(src)
|
|
return `${content}
|
|
export const meta = ${JSON.stringify(data)}
|
|
`
|
|
} catch (error) {
|
|
return src
|
|
}
|
|
}
|