Feature/#35 build tools #36

Merged
Serraniel merged 41 commits from feature/#35-build-tools into develop 2020-09-06 21:20:03 +02:00
Showing only changes of commit df33bdfa84 - Show all commits

View file

@ -3,6 +3,10 @@ const cssnano = require('cssnano')
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
const gulpLoadPlugins = require('gulp-load-plugins') const gulpLoadPlugins = require('gulp-load-plugins')
const uglify = require('gulp-uglify-es').default; const uglify = require('gulp-uglify-es').default;
const del = require('del'); const del = require('del');
const browserify = require('browserify');
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
const babelify = require('babelify');
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
const source = require('vinyl-source-stream');
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
const buffer = require('vinyl-buffer');
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
const $ = gulpLoadPlugins() const $ = gulpLoadPlugins()
@ -29,7 +33,6 @@ const tmp = {
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
scripts: '.tmp/javascript', scripts: '.tmp/javascript',
images: '.tmp/images', images: '.tmp/images',
vendor: '.tmp/libs', vendor: '.tmp/libs',
maps: '../sourcemaps',
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
} }
// Dist path // Dist path
@ -40,7 +43,6 @@ const dist = {
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
scripts: 'dist/javascript', scripts: 'dist/javascript',
images: 'dist/images', images: 'dist/images',
vendor: 'dist/libs', vendor: 'dist/libs',
maps: 'dist/sourcemaps',
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
} }
// Build mode // Build mode
@ -86,21 +88,27 @@ gulp.task('styles', () => {
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
showFiles: true showFiles: true
})) }))
// write sourcemaps // write sourcemaps
.pipe($.if(isDev, $.sourcemaps.write(tmp.maps))) .pipe($.if(isDev, $.sourcemaps.write()))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe(gulp.dest(tmp.styles)) .pipe(gulp.dest(tmp.styles))
}) })
gulp.task('scripts', () => { gulp.task('scripts', () => {
return gulp.src(`${src.scripts}/**/*.js`) let b = browserify({
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
entries: `${src.scripts}/index.js`,
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
debug: true
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
});
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
return b.transform('babelify').bundle()
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe($.plumber()) .pipe($.plumber())
.pipe($.if(isDev, $.sourcemaps.init())) .pipe(source('app.js'))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe($.babel()) .pipe(buffer())
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe($.if(isDev, $.sourcemaps.init({ loadMaps: true })))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
//.pipe(uglify({ compress: { drop_console: isProd, drop_debugger: isProd } }))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe($.rename({ suffix: '.min' })) .pipe($.rename({ suffix: '.min' }))
.pipe($.if('*.js', uglify({ compress: { drop_console: isProd, drop_debugger: isProd } })))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe($.size({ .pipe($.size({
showFiles: true, showFiles: true,
})) }))
.pipe($.if(isDev, $.sourcemaps.write(tmp.maps))) .pipe($.if(isDev, $.sourcemaps.write()))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe(gulp.dest(`${tmp.scripts}`)) .pipe(gulp.dest(`${tmp.scripts}`))
}) })
@ -165,10 +173,6 @@ gulp.task('dist:copy', (done) => {
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`) gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
.pipe(gulp.dest(dist.styles)) .pipe(gulp.dest(dist.styles))
// sourcemaps
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
gulp.src(`${tmp.root}/**/*.map`)
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
.pipe(gulp.dest(dist.root))
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
done(); done();
}) })

Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```
Serraniel commented 2020-09-04 16:08:00 +02:00 (Migrated from github.com)
Review
        debug: isDev
```suggestion debug: isDev ```