ant-design/scripts/prenpm.js

12 lines
469 B
JavaScript
Raw Normal View History

2016-04-14 11:27:31 +08:00
const fs = require('fs');
const cwd = process.cwd();
const path = require('path');
const originalIndex = fs.readFileSync(path.join(cwd, 'lib/index.js'), 'utf-8');
const newIndex = originalIndex
2016-01-14 19:38:07 +08:00
.replace(/\/components\//g, '/');
2015-07-15 12:07:11 +08:00
fs.writeFileSync(path.join(cwd, 'lib/index.js'), newIndex, 'utf-8');
2016-04-14 11:27:31 +08:00
const antdCss = path.join(cwd, 'dist/antd.css');
2015-10-22 19:09:23 +08:00
fs.createReadStream(antdCss)
.pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));
2015-07-21 18:06:42 +08:00
console.log('prenpm done');