Feature/#35 build tools #36
18
gulpfile.js
18
gulpfile.js
|
@ -15,6 +15,7 @@ Base consts
|
|||
Serraniel
commented
Review
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
// Project sources
|
||||
const src = {
|
||||
root: 'src',
|
||||
manifests: 'src/manifests',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: 'src/stylesheets',
|
||||
scripts: 'src/javascript',
|
||||
images: 'src/images',
|
||||
|
@ -23,6 +24,7 @@ const src = {
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
// Build path
|
||||
const tmp = {
|
||||
root: '.tmp',
|
||||
manifests: '.tmp/manifests',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: '.tmp/stylesheets',
|
||||
scripts: '.tmp/javascript',
|
||||
images: '.tmp/images',
|
||||
|
@ -33,6 +35,7 @@ const tmp = {
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
// Dist path
|
||||
const dist = {
|
||||
root: 'dist',
|
||||
manifests: 'dist/manifests',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: 'dist/stylesheets',
|
||||
scripts: 'dist/javascript',
|
||||
images: 'dist/images',
|
||||
|
@ -110,10 +113,21 @@ gulp.task('images', () => {
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
$.imagemin.optipng(),
|
||||
$.imagemin.svgo({ plugins: [{ cleanupIDs: false }] })
|
||||
]))
|
||||
.pipe($.size({ title: 'images' }))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.size({
|
||||
```suggestion
debug: isDev
```
|
||||
showFiles: true,
|
||||
```suggestion
debug: isDev
```
|
||||
}))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(tmp.images))
|
||||
})
|
||||
|
||||
gulp.task('manifests', () => {
|
||||
```suggestion
debug: isDev
```
|
||||
return gulp.src(`${src.manifests}/**/*.json`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.plumber())
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.size({
|
||||
```suggestion
debug: isDev
```
|
||||
showFiles: true,
|
||||
```suggestion
debug: isDev
```
|
||||
}))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(tmp.manifests))
|
||||
```suggestion
debug: isDev
```
|
||||
})
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
/* ============================================================================
|
||||
Clean
|
||||
============================================================================ */
|
||||
|
@ -128,7 +142,7 @@ gulp.task('clean', gulp.series('clean:build', 'clean:dist'))
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
BUILD CLEAN ALL
|
||||
============================================================================ */
|
||||
|
||||
gulp.task('build', gulp.series('clean:build', 'images', 'scripts', 'styles'));
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('build', gulp.series('clean:build', 'manifests', 'images', 'scripts', 'styles'));
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
/* ============================================================================
|
||||
DIST CLEAN ALL
|
||||
|
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
Loading…
Reference in a new issue