mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
15 lines
462 B
JavaScript
15 lines
462 B
JavaScript
const fs = require('fs-extra')
|
|
|
|
const demoLoader = require('../loaders/naive-ui-demo-loader')
|
|
const docLoader = require('../loaders/naive-ui-doc-loader')
|
|
|
|
module.exports = async function getTransformedVueSrc (path) {
|
|
if (path.endsWith('.demo.md')) {
|
|
const code = await fs.readFile(path, 'utf-8')
|
|
return demoLoader(code, path)
|
|
} else if (path.endsWith('.md')) {
|
|
const code = await fs.readFile(path, 'utf-8')
|
|
return docLoader(code, path)
|
|
}
|
|
}
|