2019-04-02 19:04:38 +08:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
function finalizeCompile() {
|
2022-07-04 22:08:24 +08:00
|
|
|
if (fs.existsSync(path.join(__dirname, './es'))) {
|
2022-07-05 21:55:21 +08:00
|
|
|
// Build less entry file: dist/antd.less
|
|
|
|
fs.copyFileSync(
|
|
|
|
path.join(process.cwd(), 'components', 'style', 'reset.css'),
|
|
|
|
path.join(process.cwd(), 'es', 'style', 'reset.css'),
|
2020-04-13 00:05:48 +08:00
|
|
|
);
|
|
|
|
}
|
2020-03-29 10:39:46 +08:00
|
|
|
}
|
|
|
|
|
2019-04-02 19:04:38 +08:00
|
|
|
function finalizeDist() {
|
|
|
|
if (fs.existsSync(path.join(__dirname, './dist'))) {
|
|
|
|
// Build less entry file: dist/antd.less
|
2022-07-05 21:55:21 +08:00
|
|
|
fs.copyFileSync(
|
|
|
|
path.join(process.cwd(), 'components', 'style', 'reset.css'),
|
|
|
|
path.join(process.cwd(), 'dist', 'reset.css'),
|
2020-04-13 00:05:48 +08:00
|
|
|
);
|
2019-04-02 19:04:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
compile: {
|
|
|
|
finalize: finalizeCompile,
|
|
|
|
},
|
|
|
|
dist: {
|
|
|
|
finalize: finalizeDist,
|
|
|
|
},
|
2021-08-05 15:30:03 +08:00
|
|
|
bail: true,
|
2022-10-08 16:26:48 +08:00
|
|
|
tag: 'next',
|
2019-04-02 19:04:38 +08:00
|
|
|
};
|