mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
479e4e8884
* ♻️ refactor token system interface * 📝 docs: add more token meta info to seeds and map token * 🔨 chore: update token meta generator scripts * 🚨 chore: fix lint * 📝 docs: 补充 token 的 meta 信息 * chore: add json in pkg * chore: update script * chore: update flag Co-authored-by: MadCcc <1075746765@qq.com>
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const restCssPath = path.join(process.cwd(), 'components', 'style', 'reset.css');
|
|
const tokenStatisticPath = path.join(process.cwd(), 'components', 'version', 'token.json');
|
|
const tokenMetaPath = path.join(process.cwd(), 'components', 'version', 'token-meta.json');
|
|
|
|
function finalizeCompile() {
|
|
if (fs.existsSync(path.join(__dirname, './es'))) {
|
|
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'es', 'style', 'reset.css'));
|
|
fs.copyFileSync(tokenStatisticPath, path.join(process.cwd(), 'es', 'version', 'token.json'));
|
|
fs.copyFileSync(tokenMetaPath, path.join(process.cwd(), 'es', 'version', 'token-meta.json'));
|
|
}
|
|
|
|
if (fs.existsSync(path.join(__dirname, './lib'))) {
|
|
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'lib', 'style', 'reset.css'));
|
|
fs.copyFileSync(tokenStatisticPath, path.join(process.cwd(), 'lib', 'version', 'token.json'));
|
|
fs.copyFileSync(tokenMetaPath, path.join(process.cwd(), 'lib', 'version', 'token-meta.json'));
|
|
}
|
|
}
|
|
|
|
function finalizeDist() {
|
|
if (fs.existsSync(path.join(__dirname, './dist'))) {
|
|
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'dist', 'reset.css'));
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
compile: {
|
|
finalize: finalizeCompile,
|
|
},
|
|
dist: {
|
|
finalize: finalizeDist,
|
|
},
|
|
bail: true,
|
|
};
|