Fix code style
This commit is contained in:
parent
7da5778124
commit
532fa2da93
1 changed files with 13 additions and 13 deletions
26
gulpfile.js
26
gulpfile.js
|
@ -8,7 +8,7 @@ const source = require('vinyl-source-stream');
|
||||||
const sass = require('gulp-sass');
|
const sass = require('gulp-sass');
|
||||||
const autoprefixer = require('gulp-autoprefixer');
|
const autoprefixer = require('gulp-autoprefixer');
|
||||||
const cleanCSS = require('gulp-clean-css');
|
const cleanCSS = require('gulp-clean-css');
|
||||||
const rename = require("gulp-rename");
|
const rename = require('gulp-rename');
|
||||||
const replace = require('gulp-replace');
|
const replace = require('gulp-replace');
|
||||||
|
|
||||||
// Browserify
|
// Browserify
|
||||||
|
@ -35,8 +35,8 @@ gulp.task('build-js', ['browserify'], cb => {
|
||||||
gulp.src(['js/index.js', 'js/bundle.js']),
|
gulp.src(['js/index.js', 'js/bundle.js']),
|
||||||
babel({presets: ['env'], plugins: ['@babel/plugin-transform-object-assign']}),
|
babel({presets: ['env'], plugins: ['@babel/plugin-transform-object-assign']}),
|
||||||
uglify(),
|
uglify(),
|
||||||
rename({extname: ".min.js"}),
|
rename({extname: '.min.js'}),
|
||||||
gulp.dest('build/js')
|
gulp.dest('build/js')
|
||||||
], cb);
|
], cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -50,20 +50,20 @@ gulp.task('build-css', ['sass'], cb => {
|
||||||
cascade: false
|
cascade: false
|
||||||
}),
|
}),
|
||||||
cleanCSS({compatibility: 'ie8'}),
|
cleanCSS({compatibility: 'ie8'}),
|
||||||
rename({extname: ".min.css"}),
|
rename({extname: '.min.css'}),
|
||||||
gulp.dest('build/css')
|
gulp.dest('build/css')
|
||||||
], cb);
|
], cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('replace-path', cb =>{
|
gulp.task('replace-path', cb => {
|
||||||
pump([
|
pump([
|
||||||
gulp.src('index.html'),
|
gulp.src('index.html'),
|
||||||
replace('src="js/', 'src="build/js/'),
|
replace('src="js/', 'src="build/js/'),
|
||||||
replace('.js', '.min.js'),
|
replace('.js', '.min.js'),
|
||||||
replace('href="css/', 'href="build/css/'),
|
replace('href="css/', 'href="build/css/'),
|
||||||
replace('.css', '.min.css'),
|
replace('.css', '.min.css'),
|
||||||
gulp.dest('./')
|
gulp.dest('./')
|
||||||
], cb);
|
], cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Build app
|
// Build app
|
||||||
|
|
Loading…
Add table
Reference in a new issue