You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
589 B

'use strict';
const fs = require('fs');
const path = require('path');
const R = require('ramda');
const utils = require('./utils');
module.exports = function buildCommon(dirs, outputFile) {
const mds = utils.findMDFile(dirs, true)
.filter((file) => !/install_en\.md$/gi.test(file)); // TODO
let content = 'module.exports = {';
mds.forEach((fileName) => {
const requirePath = path.relative(path.dirname(outputFile), fileName);
content += `\n '${fileName}': require('antd-md!${requirePath}'),`;
});
content += '\n};';
fs.writeFile(outputFile, content);
};