[bugfix] Icon: error when custom style (#2325)

This commit is contained in:
neverland 2018-12-18 23:16:18 +08:00 committed by GitHub
parent dcc642ac59
commit ca043fd36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,5 @@
const fs = require('fs-extra');
const glob = require('fast-glob');
const path = require('path');
const gulp = require('gulp');
const less = require('gulp-less');
@ -16,4 +18,15 @@ gulp.task('compile', () => (
.pipe(gulp.dest(file => file.base.replace('.less', '.css')))
));
gulp.task('default', ['compile']);
// icon.less should be replaced by compiled file
gulp.task('default', ['compile'], () => (
glob([
'../es/icon/*.css',
'../lib/icon/*.css'
]).then(files => {
files.forEach(file => {
file = path.join(__dirname, file);
fs.copyFileSync(file, file.replace('.css', '.less'));
});
})
));