1 Star 1 Fork 0

SCH / hexo-admin-sch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gulpfile.js 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
SCH 提交于 2023-01-20 14:05 . Update
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gutil = require('gulp-util');
// var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var reactify = require('reactify');
var rename = require('gulp-rename');
gulp.task('demo', function () {
var b = browserify({
entries: './docs/demo/run.js',
debug: true,
transform: [[reactify, {es6: true, everything: true}]]
});
return b.bundle()
.pipe(source('./docs/demo/run.js'))
.pipe(buffer())
.pipe(rename('bundle.js'))
.pipe(gulp.dest('./docs/demo/admin/'));
});
gulp.task('javascript', function () {
var b = browserify({
entries: './client/run.js',
debug: true,
transform: [[reactify, {es6: true, everything: true}]]
});
return b.bundle()
.pipe(source('./client/run.js'))
.pipe(buffer())
// .pipe(sourcemaps.init({loadMaps: true}))
// Add transformation tasks to the pipeline here.
// .pipe(uglify())
// .on('error', gutil.log)
// .pipe(sourcemaps.write('./'))
.pipe(rename('bundle.js'))
.pipe(gulp.dest('./www/'));
});
var less = require('gulp-less');
gulp.task('less', function () {
return gulp.src('./client/less/index.less')
.pipe(less({
// paths: [path.join(__dirname,
}))
.pipe(rename('bundle.css'))
.pipe(gulp.dest('./www'))
});
gulp.task('build', ['less', 'javascript']);
gulp.task('watch', function () {
gulp.watch('client/**/*.js', ['javascript']);
gulp.watch('client/**/*.less', ['less']);
});
gulp.task('default', ['build', 'watch']);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/schlibra/hexo-admin-sch.git
git@gitee.com:schlibra/hexo-admin-sch.git
schlibra
hexo-admin-sch
hexo-admin-sch
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891