ant-design/scripts/build-common.js

19 lines
508 B
JavaScript
Raw Normal View History

2016-03-02 11:57:37 +08:00
'use strict';
const fs = require('fs');
const R = require('ramda');
const utils = require('./utils');
2016-03-04 18:06:34 +08:00
module.exports = function buildCommon(dirs, outputFile) {
const mds = utils.findMDFile(dirs, true)
.filter((file) => !/install_en\.md$/gi.test(file)); // TODO
2016-03-02 11:57:37 +08:00
2016-03-04 15:19:23 +08:00
let content = 'module.exports = {';
2016-03-08 15:35:03 +08:00
mds.forEach((fileName) => {
content += `\n '${fileName}': require('antd-md?fileName=${fileName}!../../${fileName}'),`;
2016-03-04 15:19:23 +08:00
});
content += '\n};';
2016-03-02 11:57:37 +08:00
2016-03-03 11:12:46 +08:00
fs.writeFile(outputFile, content);
2016-03-02 11:57:37 +08:00
};