2019-04-02 19:04:38 +08:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
2022-11-22 16:21:37 +08:00
|
|
|
const restCssPath = path.join(process.cwd(), 'components', 'style', 'reset.css');
|
|
|
|
|
2019-04-02 19:04:38 +08:00
|
|
|
function finalizeCompile() {
|
2022-07-04 22:08:24 +08:00
|
|
|
if (fs.existsSync(path.join(__dirname, './es'))) {
|
2022-11-22 16:21:37 +08:00
|
|
|
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'es', 'style', 'reset.css'));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fs.existsSync(path.join(__dirname, './lib'))) {
|
|
|
|
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'lib', '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'))) {
|
2022-11-22 16:21:37 +08:00
|
|
|
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'dist', 'reset.css'));
|
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,
|
2019-04-02 19:04:38 +08:00
|
|
|
};
|