mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
build: throw error when compile style failed
This commit is contained in:
parent
d7ef84d8cf
commit
48bd6d86d8
@ -16,15 +16,19 @@ const tasks = [
|
||||
'cross-env NODE_ENV=production webpack -p --color --config build/webpack.pkg.js'
|
||||
];
|
||||
|
||||
tasks.forEach(task => {
|
||||
tasks.every(task => {
|
||||
signale.start(task);
|
||||
|
||||
const interactive = new Signale({ interactive: true });
|
||||
interactive.pending(task);
|
||||
|
||||
const result = shell.exec(`${task} --silent`);
|
||||
|
||||
if (result.code !== 0) {
|
||||
interactive.error(task);
|
||||
} else {
|
||||
interactive.success(task);
|
||||
return false;
|
||||
}
|
||||
|
||||
interactive.success(task);
|
||||
return true;
|
||||
});
|
||||
|
@ -48,14 +48,19 @@ async function dest(output, paths) {
|
||||
// compile component css
|
||||
async function compile() {
|
||||
let codes;
|
||||
const paths = await glob(['./es/**/*.less', './lib/**/*.less'], { absolute: true });
|
||||
try {
|
||||
const paths = await glob(['./es/**/*.less', './lib/**/*.less'], { absolute: true });
|
||||
|
||||
codes = await Promise.all(paths.map(path => fs.readFile(path, 'utf-8')));
|
||||
codes = await compileLess(codes, paths);
|
||||
codes = await compilePostcss(codes, paths);
|
||||
codes = await compileCsso(codes);
|
||||
codes = await Promise.all(paths.map(path => fs.readFile(path, 'utf-8')));
|
||||
codes = await compileLess(codes, paths);
|
||||
codes = await compilePostcss(codes, paths);
|
||||
codes = await compileCsso(codes);
|
||||
|
||||
await dest(codes, paths);
|
||||
await dest(codes, paths);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
compile();
|
||||
|
Loading…
x
Reference in New Issue
Block a user