Commit 8fda06a5 authored by cinwell.li's avatar cinwell.li Committed by FuryBean

feat: auto generator cssfile (#368)

parent 2bbd8d08
var fs = require('fs');
var path = require('path');
var Components = require('../../components.json');
var THEMES = [
'theme-default'
];
var BASEPATH = path.resolve(__dirname, '../../packages/');
Components = Object.keys(Components);
function fileExists(filePath) {
try {
return fs.statSync(filePath).isFile();
} catch (err) {
return false;
}
};
THEMES.forEach(function(theme) {
Components.forEach(function(key) {
var fileName = key + '.css';
var filePath = path.resolve(BASEPATH, theme, 'src', fileName);
if (!fileExists(filePath)) {
fs.writeFileSync(filePath, '', 'utf8');
console.log(theme, ' 创建遗漏的 ', fileName, ' 文件');
}
});
});
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"dev": "npm run bootstrap && npm run build:file && cooking watch -c build/cooking.demo.js -p", "dev": "npm run bootstrap && npm run build:file && cooking watch -c build/cooking.demo.js -p",
"dist": "npm run clean && npm run build:file && npm run lint && cooking build -c build/cooking.conf.js,build/cooking.common.js,build/cooking.component.js -p && npm run build:utils && npm run build:theme", "dist": "npm run clean && npm run build:file && npm run lint && cooking build -c build/cooking.conf.js,build/cooking.common.js,build/cooking.component.js -p && npm run build:utils && npm run build:theme",
"dist:all": "node build/bin/build-all.js && npm run build:theme", "dist:all": "node build/bin/build-all.js && npm run build:theme",
"build:theme": "gulp build --gulpfile packages/theme-default/gulpfile.js && cp-cli packages/theme-default/lib lib/theme-default", "build:theme": "node build/bin/gen-cssfile && gulp build --gulpfile packages/theme-default/gulpfile.js && cp-cli packages/theme-default/lib lib/theme-default",
"deploy": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui", "deploy": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui",
"bootstrap": "npm i && lerna bootstrap", "bootstrap": "npm i && lerna bootstrap",
"pub": "sh build/release.sh", "pub": "sh build/release.sh",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment