const fs = require('fs') const gulp = require('gulp') const uglify = require('gulp-uglify') const header = require('gulp-header') const License = fs.readFileSync('LICENSE') const chinese2unicode = require('gulp-chinese2unicode') // 构建 gulp.task('minify', async () => { console.log('开始构建...') gulp .src('Pandora.min.js', { //sourcemaps: true, }) .pipe(uglify()) .pipe(chinese2unicode()) .pipe(header(`/*\n${License.toString('utf-8')}\n*/\n`)) .on('data', function () { console.log('构建完成!') }) .pipe( gulp.dest('./', { // sourcemaps: ".", }) ) })