Feature/#35 build tools #36
102
gulpfile.js
102
gulpfile.js
|
@ -7,6 +7,7 @@ const browserify = require('browserify');
|
|||
Serraniel
commented
Review
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
const babelify = require('babelify');
|
||||
const source = require('vinyl-source-stream');
|
||||
const buffer = require('vinyl-buffer');
|
||||
const merge = require('merge-stream');
|
||||
```suggestion
debug: isDev
```
|
||||
const fs = require('fs');
|
||||
|
||||
const $ = gulpLoadPlugins()
|
||||
|
@ -33,17 +34,30 @@ const tmp = {
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
styles: '.tmp/stylesheets',
|
||||
scripts: '.tmp/javascript',
|
||||
images: '.tmp/images',
|
||||
vendor: '.tmp/libs',
|
||||
```suggestion
debug: isDev
```
|
||||
}
|
||||
|
||||
// Dist path
|
||||
const dist = {
|
||||
root: 'dist',
|
||||
manifests: 'dist/manifests',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: 'dist/stylesheets',
|
||||
```suggestion
debug: isDev
```
|
||||
scripts: 'dist/javascript',
|
||||
```suggestion
debug: isDev
```
|
||||
images: 'dist/images',
|
||||
```suggestion
debug: isDev
```
|
||||
vendor: 'dist/libs',
|
||||
```suggestion
debug: isDev
```
|
||||
chrome: {
|
||||
```suggestion
debug: isDev
```
|
||||
root: 'dist/chrome',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: 'dist/chrome/stylesheets',
|
||||
```suggestion
debug: isDev
```
|
||||
scripts: 'dist/chrome/javascript',
|
||||
```suggestion
debug: isDev
```
|
||||
images: 'dist/chrome/images',
|
||||
```suggestion
debug: isDev
```
|
||||
},
|
||||
```suggestion
debug: isDev
```
|
||||
firefox: {
|
||||
```suggestion
debug: isDev
```
|
||||
root: 'dist/firefox',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: 'dist/firefox/stylesheets',
|
||||
```suggestion
debug: isDev
```
|
||||
scripts: 'dist/firefox/javascript',
|
||||
```suggestion
debug: isDev
```
|
||||
images: 'dist/firefox/images',
|
||||
```suggestion
debug: isDev
```
|
||||
},
|
||||
```suggestion
debug: isDev
```
|
||||
opera: {
|
||||
```suggestion
debug: isDev
```
|
||||
root: 'dist/opera',
|
||||
```suggestion
debug: isDev
```
|
||||
styles: 'dist/opera/stylesheets',
|
||||
```suggestion
debug: isDev
```
|
||||
scripts: 'dist/opera/javascript',
|
||||
```suggestion
debug: isDev
```
|
||||
images: 'dist/opera/images',
|
||||
```suggestion
debug: isDev
```
|
||||
},
|
||||
```suggestion
debug: isDev
```
|
||||
zip: 'dist/zips',
|
||||
```suggestion
debug: isDev
```
|
||||
}
|
||||
|
||||
// Build mode
|
||||
|
@ -169,24 +183,82 @@ gulp.task('build', gulp.series('clean:build', 'manifests', 'images', 'scripts',
|
|||
```suggestion
debug: isDev
```
```suggestion
debug: isDev
```
|
||||
DIST CLEAN ALL
|
||||
============================================================================ */
|
||||
|
||||
gulp.task('dist:copy', (done) => {
|
||||
```suggestion
debug: isDev
```
|
||||
// copy vendor
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.vendor}/**/*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.vendor))
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('dist:chrome', (done) => {
|
||||
```suggestion
debug: isDev
```
|
||||
return merge(
|
||||
```suggestion
debug: isDev
```
|
||||
// copy images
|
||||
gulp.src(`${tmp.images}/**/*`)
|
||||
.pipe(gulp.dest(dist.images))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.chrome.images)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
// copy scripts
|
||||
gulp.src(`${tmp.scripts}/**/*.{min.js,min.js.gz}`)
|
||||
.pipe(gulp.dest(dist.scripts))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.chrome.scripts)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
// copy styles
|
||||
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
|
||||
.pipe(gulp.dest(dist.styles))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.chrome.styles)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.manifests}/chrome*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.rename('manifest.json'))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.chrome.root))
|
||||
```suggestion
debug: isDev
```
|
||||
);
|
||||
```suggestion
debug: isDev
```
|
||||
})
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('dist:firefox', (done) => {
|
||||
```suggestion
debug: isDev
```
|
||||
return merge(
|
||||
```suggestion
debug: isDev
```
|
||||
// copy images
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.images}/**/*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.firefox.images)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
// copy scripts
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.scripts}/**/*.{min.js,min.js.gz}`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.firefox.scripts)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
// copy styles
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.firefox.styles)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.manifests}/firefox*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.rename('manifest.json'))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.firefox.root))
|
||||
```suggestion
debug: isDev
```
|
||||
);
|
||||
```suggestion
debug: isDev
```
|
||||
})
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('dist:opera', (done) => {
|
||||
```suggestion
debug: isDev
```
|
||||
return merge(
|
||||
```suggestion
debug: isDev
```
|
||||
// copy images
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.images}/**/*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.opera.images)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
// copy scripts
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.scripts}/**/*.{min.js,min.js.gz}`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.opera.scripts)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
// copy styles
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.styles}/*.{min.css,min.css.gz}`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.opera.styles)),
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${tmp.manifests}/opera*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.rename('manifest.json'))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.opera.root))
|
||||
```suggestion
debug: isDev
```
|
||||
);
|
||||
```suggestion
debug: isDev
```
|
||||
})
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('dist:copy', gulp.series('dist:chrome', 'dist:firefox', 'dist:opera'));
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('dist:zip', (done) => {
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${dist.chrome.root}/**/*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.zip('chrome.zip'))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.root));
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${dist.firefox.root}/**/*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.zip('firefox.zip'))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.root));
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.src(`${dist.opera.root}/**/*`)
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe($.zip('opera.zip'))
|
||||
```suggestion
debug: isDev
```
|
||||
.pipe(gulp.dest(dist.root));
|
||||
```suggestion
debug: isDev
```
|
||||
|
||||
done();
|
||||
})
|
||||
|
||||
gulp.task('dist', gulp.series('clean', 'build', 'dist:copy'));
|
||||
```suggestion
debug: isDev
```
|
||||
gulp.task('dist', gulp.series('clean', 'build', 'dist:copy', 'dist:zip'));
|
||||
```suggestion
debug: isDev
```
|
|
@ -34,6 +34,7 @@
|
|||
Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors. Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors.
Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors. Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors.
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-uglify-es": "^2.0.0",
|
||||
"gulp-zip": "^5.0.2",
|
||||
"merge-stream": "^2.0.0",
|
||||
Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors. Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors.
|
||||
"sass": "^1.26.10",
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
"vinyl-source-stream": "^2.0.0"
|
||||
|
|
|||
Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors. Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors.
Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors. Also feel free to add yourself here any time you like, see https://docs.npmjs.com/files/package.json#people-fields-author-contributors.
|
Loading…
Reference in a new issue