ant-design/scripts/build-common.js

19 lines
469 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 = {';
mds.forEach((md) => {
content += `\n '${md}': require('antd-md!../../${md}'),`;
});
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
};