demo-apppp
v1.0.0
Published
```js const gulp = require('gulp'); const babel = require('gulp-babel'); const uglify = require('gulp-uglify');; const htmlminify = require('gulp-html-minify'); const cleanCSS = require('gulp-clean-css'); const sass = require('gulp-sass'); // 转义es6
Downloads
2
Readme
const gulp = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');;
const htmlminify = require('gulp-html-minify');
const cleanCSS = require('gulp-clean-css');
const sass = require('gulp-sass');
// 转义es6-es5
gulp.task('js', () =>
gulp.src('app/public/*.js')
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(uglify())
.pipe(gulp.dest('app/dist/js'))
);
// 打包压缩html
gulp.task('html', () =>
gulp.src('app/public/*.html')
.pipe(htmlminify())
.pipe(gulp.dest('app/dist/html'))
);
//压缩sass和css
gulp.task('css', () => {
return gulp.src('app/public/*.css')
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(gulp.dest('app/dist/css'));
});
gulp.task('css', () => {
return gulp.src('app/public/*.css')
.pipe(cleanCSS({ compatibility: 'ie8' }))
.pipe(gulp.dest('app/dist/css'));
});
gulp.task('scss', () => {
return gulp.src('app/public/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(cleanCSS())
.pipe(gulp.dest('app/dist/css'))
})