mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
32 lines
699 B
JavaScript
32 lines
699 B
JavaScript
const gulp = require('gulp');
|
|
const webpack = require('webpack');
|
|
const webpackConfig = require('./webpack.config');
|
|
const del = require('del');
|
|
|
|
gulp.task('clean', function () {
|
|
del('dist')
|
|
});
|
|
|
|
gulp.task('build', function () {
|
|
webpack(webpackConfig, function (error) {
|
|
if (error) {
|
|
console.log('webpack failed');
|
|
console.log(error);
|
|
}
|
|
});
|
|
});
|
|
|
|
gulp.task('resources', function () {
|
|
const res = [];
|
|
excluding('web/app', res);
|
|
excluding('web/test', res);
|
|
res.push('web/**/*');
|
|
gulp.src(res).pipe(gulp.dest('dist'));
|
|
});
|
|
|
|
function excluding(path, filter) {
|
|
filter.push('!' + path + '/**/*', '!' + path);
|
|
}
|
|
|
|
|
|
gulp.task('default', ['clean', 'build', 'resources']);
|