Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a780e99
commit cd3051a
Showing
66 changed files
with
12,717 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
dist | ||
|
||
index2.html.gz |
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 |
---|---|---|
@@ -0,0 +1,149 @@ | ||
var gulp = require('gulp'), | ||
jshint = require('gulp-jshint'), | ||
gulpif = require('gulp-if'), | ||
concat = require('gulp-concat'), | ||
uglify = require('gulp-uglify'), | ||
cleanCSS = require('gulp-clean-css'), | ||
removeCode = require('gulp-remove-code'), | ||
merge = require('merge-stream'), | ||
del = require('del'), | ||
zip = require('gulp-zip'), | ||
gzip = require('gulp-gzip'), | ||
htmlmin = require('gulp-htmlmin'), | ||
replace = require('gulp-replace'), | ||
fs = require('fs'), | ||
smoosher = require('gulp-smoosher'); | ||
|
||
var demoMode = false; | ||
var testMode = false; | ||
|
||
function clean() { | ||
return del(['dist']); | ||
} | ||
|
||
function clean2() { | ||
return del(['dist/js', 'dist/css']); | ||
} | ||
function lint() { | ||
return gulp.src('www/js/**/app.js') | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('default')); | ||
} | ||
|
||
function Copytest() { | ||
return merge( | ||
gulp.src(['www/index.html']) | ||
.pipe(removeCode({production: false})) | ||
.pipe(gulp.dest('dist')), | ||
gulp.src(['www/images/**/*.*']) | ||
.pipe(gulp.dest('dist/images')) | ||
) | ||
} | ||
|
||
function Copy() { | ||
return merge( | ||
gulp.src(['www/index.html']) | ||
.pipe(removeCode({production: true})) | ||
.pipe(gulp.dest('dist')), | ||
gulp.src(['www/images/**/*.*']) | ||
.pipe(gulp.dest('dist/images')) | ||
) | ||
} | ||
|
||
function concatApptest() { | ||
return merge( | ||
gulp.src([ 'www/js/**/*.js']) | ||
.pipe(concat('app.js')) | ||
.pipe(removeCode({production: false})) | ||
.pipe(gulp.dest('./dist/js')), | ||
|
||
gulp.src([ 'www/css/**/*.css']) | ||
.pipe(concat('style.css')) | ||
.pipe(gulp.dest('./dist/css/')) | ||
) | ||
} | ||
|
||
function concatApp() { | ||
return merge( | ||
gulp.src([ 'www/js/**/*.js']) | ||
.pipe(concat('app.js')) | ||
.pipe(removeCode({production: true})) | ||
.pipe(gulp.dest('./dist/js')), | ||
|
||
gulp.src([ 'www/css/**/*.css']) | ||
.pipe(concat('style.css')) | ||
.pipe(gulp.dest('./dist/css/')) | ||
) | ||
} | ||
|
||
function replaceSVG() { | ||
return gulp.src('dist/index.html') | ||
.pipe(replace(/<!-- replaceSVG -->(.*?)<!-- \/replaceSVG -->/g, function (match, p1) { | ||
return fs.readFileSync('dist/images/jogdial.svg', 'utf8'); | ||
})) | ||
.pipe(gulp.dest('dist')) | ||
} | ||
|
||
function minifyApp() { | ||
return merge( | ||
gulp.src(['dist/js/app.js']) | ||
.pipe(uglify({mangle: true})) | ||
.pipe(gulp.dest('./dist/js/')), | ||
|
||
gulp.src('dist/css/style.css') | ||
.pipe(cleanCSS({debug: true}, function(details) { | ||
console.log(details.name + ': ' + details.stats.originalSize); | ||
console.log(details.name + ': ' + details.stats.minifiedSize); | ||
})) | ||
.pipe(gulp.dest('./dist/css/')), | ||
|
||
gulp.src('dist/index.html') | ||
.pipe(htmlmin({collapseWhitespace: true, minifyCSS: true})) | ||
.pipe(gulp.dest('dist')) | ||
) | ||
} | ||
|
||
function includehtml() { | ||
return merge( | ||
gulp.src('dist/index.html') | ||
.pipe(replace(/<file-include w3-include-html="'sub\/(.*?)'"><\/file-include>/g, function (match, p1) { | ||
return fs.readFileSync('www/sub/' + p1, 'utf8'); | ||
})) | ||
.pipe(gulp.dest('dist/')) | ||
) | ||
} | ||
|
||
function smoosh() { | ||
return gulp.src('dist/index.html') | ||
.pipe(smoosher()) | ||
.pipe(gulp.dest('dist')) | ||
} | ||
|
||
function compress() { | ||
return gulp.src('dist/index.html') | ||
.pipe(gzip()) | ||
.pipe(gulp.dest('.')); | ||
} | ||
|
||
gulp.task(clean); | ||
gulp.task(lint); | ||
gulp.task(Copy); | ||
gulp.task(Copytest); | ||
gulp.task(replaceSVG); | ||
gulp.task(concatApp); | ||
gulp.task(concatApptest); | ||
gulp.task(minifyApp); | ||
gulp.task(smoosh); | ||
gulp.task(clean2); | ||
|
||
var defaultSeries = gulp.series(clean, lint, Copy, concatApp, minifyApp, includehtml, includehtml, smoosh); | ||
//var packageSeries = gulp.series(clean, lint, Copy, concatApp, minifyApp, smoosh, compress); | ||
var packageSeries = gulp.series(clean, lint, Copy, concatApp, includehtml, includehtml, replaceSVG, minifyApp, smoosh, compress, clean2); | ||
var package2Series = gulp.series(clean, lint, Copy, concatApp, includehtml, includehtml, replaceSVG, smoosh); | ||
var package2testSeries = gulp.series(clean, lint, Copy, concatApptest, includehtml, includehtml, replaceSVG, smoosh); | ||
|
||
gulp.task('default', defaultSeries); | ||
gulp.task('package', packageSeries); | ||
gulp.task('package2', package2Series); | ||
gulp.task('package2test', package2testSeries); | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
npm install --global gulp-cli | ||
npm install --save-dev gulp | ||
npm install --save-dev gulp-jshint | ||
npm install --save-dev jshint | ||
npm install --save-dev gulp-if | ||
npm install --save-dev gulp-concat | ||
npm install --save-dev gulp-uglify | ||
npm install --save-dev gulp-clean-css | ||
npm install --save-dev gulp-remove-code | ||
npm install --save-dev del | ||
npm install --save-dev gulp-zip | ||
npm install --save-dev gulp-gzip | ||
npm install --save-dev gulp-htmlmin | ||
npm install --save-dev gulp-replace | ||
npm install --save-dev gulp-smoosher |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "ESP3D-WebUI", | ||
"description": "Web UI for ESP3D", | ||
"devDependencies": { | ||
"del": "^2.2.2", | ||
"deprecated": "0.0.1", | ||
"fs": "0.0.1-security", | ||
"gulp": "github:gulpjs/gulp#4.0", | ||
"gulp-bytediff": "^1.0.0", | ||
"gulp-cdnizer": "^1.1.7", | ||
"gulp-clean-css": "^2.4.0", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-gzip": "^1.4.0", | ||
"gulp-htmlmin": "^3.0.0", | ||
"gulp-if": "^2.0.2", | ||
"gulp-jshint": "^2.0.4", | ||
"gulp-ng-annotate": "^2.0.0", | ||
"gulp-remove-code": "^1.0.2", | ||
"gulp-replace": "^0.5.4", | ||
"gulp-smoosher": "0.0.9", | ||
"gulp-uglify": "^2.1.2", | ||
"gulp-util": "^3.0.1", | ||
"gulp-zip": "^3.2.0", | ||
"jshint": "^2.9.4", | ||
"merge-stream": "^1.0.1" | ||
}, | ||
"repository": "https://github.com/luc-github/ESP3D-WEBUI", | ||
"author": "Luc LEBOSSE", | ||
"license": "(ISC OR GPL-3.0)" | ||
} |
Oops, something went wrong.