mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
components.less for custom less theme
This commit is contained in:
parent
e9f083015e
commit
54045fc7c2
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "1.0.0-beta.6",
|
||||
"version": "1.0.0-beta.7",
|
||||
"title": "Ant Design",
|
||||
"description": "一个 UI 设计语言",
|
||||
"homepage": "http://ant.design/",
|
||||
|
@ -6,15 +6,22 @@
|
||||
// Build a entry less file to dist/antd.less
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var componentsPath = path.join(process.cwd(), 'components');
|
||||
var entryLessContent = `@import "../lib/style/index.less";`;
|
||||
console.log('Building a entry less file to dist/antd.less');
|
||||
var componentsPath = path.join(process.cwd(), 'components');
|
||||
var componentsLessContent = '';
|
||||
|
||||
// Build components in one file: lib/style/components.less
|
||||
fs.readdir(componentsPath, function(err, files) {
|
||||
files.forEach(function(file) {
|
||||
if (fs.existsSync(path.join(componentsPath, file, 'style', 'index.less'))) {
|
||||
entryLessContent += `\n@import "../lib/${path.join(file, 'style', 'index.less')}";`
|
||||
componentsLessContent += `@import "../${path.join(file, 'style', 'index.less')}";\n`
|
||||
}
|
||||
});
|
||||
fs.writeFileSync(path.join(process.cwd(), 'dist', 'antd.less'), entryLessContent);
|
||||
fs.writeFileSync(path.join(process.cwd(), 'lib', 'style', 'components.less'), componentsLessContent);
|
||||
|
||||
// Build less entry file: dist/antd.less
|
||||
fs.writeFileSync(
|
||||
path.join(process.cwd(), 'dist', 'antd.less'),
|
||||
'@import "../lib/style/index.less";\n@import "../lib/style/components.less";'
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user