-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to gulp 4 and update others gulp plugins (#41)
- Loading branch information
1 parent
d4523a5
commit 648ece2
Showing
3 changed files
with
32 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,50 @@ | ||
import gulp from 'gulp'; | ||
import pkg from './package.json'; | ||
import header from 'gulp-header'; | ||
import cssimport from 'gulp-cssimport'; | ||
import del from 'del'; | ||
import plugins from 'gulp-load-plugins'; | ||
import del from 'del'; | ||
|
||
import pkg from './package.json'; | ||
|
||
const license = `/* ${pkg.name} ${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`; | ||
|
||
const src = './src/'; | ||
const src = './src'; | ||
const dist = './dist/'; | ||
const main = 'main.css'; | ||
let files = [ | ||
`${src}/_base.css`, | ||
`${src}/_helpers.css`, | ||
`${src}/_mqs.css`, | ||
`${src}/_print.css` | ||
]; | ||
|
||
|
||
gulp.task('concat', () => { | ||
gulp.src(src + main) | ||
.pipe(cssimport()) | ||
.pipe(header(license)) | ||
return gulp.src(`${src}/main.css`) | ||
.pipe(plugins().cssimport()) | ||
.pipe(plugins().header(license)) | ||
.pipe(plugins().autoprefixer({ | ||
cascade: false | ||
})) | ||
.pipe(gulp.dest(dist)); | ||
}); | ||
|
||
gulp.task('copy', () => { | ||
gulp.src(files,{}) | ||
.pipe(header(license)) | ||
return gulp.src(files, {}) | ||
.pipe(plugins().header(license)) | ||
.pipe(gulp.dest(dist)); | ||
}); | ||
gulp.task('clean', () => { | ||
del([dist]); | ||
|
||
gulp.task('clean', (done) => { | ||
del([ | ||
dist | ||
]).then(() => { | ||
done(); | ||
}); | ||
}); | ||
|
||
gulp.task('default',['copy','concat']); | ||
gulp.task( | ||
'build', | ||
gulp.series( | ||
'clean', | ||
gulp.parallel('copy', 'concat') | ||
) | ||
); | ||
|
||
gulp.task('default', gulp.series('build')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters