1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Upgraded gulp to v4

This commit is contained in:
Uncled1023 2020-06-23 00:18:41 -07:00
parent 22f2a1ae00
commit 8cb3022866
6 changed files with 3382 additions and 2520 deletions

View File

@ -57,21 +57,21 @@ gulp.task("clean", function (cb) {
return rimraf("./wwwroot/*", cb); return rimraf("./wwwroot/*", cb);
}); });
gulp.task('copy-assets', function () { gulp.task('copy-assets', function (done) {
var streams = []; var streams = [];
for (var asset in assets) { for (var asset in assets) {
for (var item in assets[asset]) { for (var item in assets[asset]) {
streams.push(gulp.src(item).pipe(gulp.dest('./wwwroot/' + assets[asset][item]))); streams.push(gulp.src(item).pipe(gulp.dest('./wwwroot/' + assets[asset][item])));
} }
} }
done();
}); });
gulp.task("load-bundle", function () { gulp.task("load-bundle", function (done) {
bundleconfig = require("./bundleconfig.json"); bundleconfig = require("./bundleconfig.json");
done();
}); });
gulp.task("min", ["min:js", "min:css"]);
gulp.task("min:js", function () { gulp.task("min:js", function () {
var tasks = getBundles(".js").map(function (bundle) { var tasks = getBundles(".js").map(function (bundle) {
return gulp.src(bundle.inputFiles, { base: "." }) return gulp.src(bundle.inputFiles, { base: "." })
@ -92,6 +92,8 @@ gulp.task("min:css", function () {
return merge(tasks); return merge(tasks);
}); });
gulp.task("min", gulp.parallel("min:js", "min:css"));
gulp.task("update-version", function () { gulp.task("update-version", function () {
return gulp.src('./App_Data/version.template.json') return gulp.src('./App_Data/version.template.json')
.pipe(replace('{{git_ver}}', git.tag())) .pipe(replace('{{git_ver}}', git.tag()))
@ -100,7 +102,7 @@ gulp.task("update-version", function () {
.pipe(gulp.dest('./App_Data')); .pipe(gulp.dest('./App_Data'));
}); });
gulp.task("watch", function () { gulp.task("watch", function (done) {
// Watch Source Files // Watch Source Files
assets.forEach(function (src) { assets.forEach(function (src) {
for (var key in src) { for (var key in src) {
@ -119,6 +121,8 @@ gulp.task("watch", function () {
getBundles(".css").forEach(function (bundle) { getBundles(".css").forEach(function (bundle) {
gulp.watch(bundle.inputFiles, ["min:css"]); gulp.watch(bundle.inputFiles, ["min:css"]);
}); });
done();
}); });
function getBundles(extension) { function getBundles(extension) {

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@
"devDependencies": { "devDependencies": {
"del": "^3.0.0", "del": "^3.0.0",
"git-rev-sync": "^1.12.0", "git-rev-sync": "^1.12.0",
"gulp": "^3.9.1", "gulp": "^4.0.2",
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-cssmin": "^0.2.0", "gulp-cssmin": "^0.2.0",
"gulp-rename": "^1.3.0", "gulp-rename": "^1.3.0",

View File

@ -82,21 +82,21 @@ gulp.task("clean", function (cb) {
return rimraf("./wwwroot/*", cb); return rimraf("./wwwroot/*", cb);
}); });
gulp.task('copy-assets', function () { gulp.task('copy-assets', function (done) {
var streams = []; var streams = [];
for (var asset in assets) { for (var asset in assets) {
for (var item in assets[asset]) { for (var item in assets[asset]) {
streams.push(gulp.src(item).pipe(gulp.dest('./wwwroot/' + assets[asset][item]))); streams.push(gulp.src(item).pipe(gulp.dest('./wwwroot/' + assets[asset][item])));
} }
} }
done();
}); });
gulp.task("load-bundle", function () { gulp.task("load-bundle", function (done) {
bundleconfig = require("./bundleconfig.json"); bundleconfig = require("./bundleconfig.json");
done();
}); });
gulp.task("min", ["min:js", "min:css"]);
gulp.task("min:js", function () { gulp.task("min:js", function () {
var tasks = getBundles(".js").map(function (bundle) { var tasks = getBundles(".js").map(function (bundle) {
return gulp.src(bundle.inputFiles, { base: "." }) return gulp.src(bundle.inputFiles, { base: "." })
@ -117,6 +117,8 @@ gulp.task("min:css", function () {
return merge(tasks); return merge(tasks);
}); });
gulp.task("min", gulp.parallel("min:js", "min:css"));
gulp.task("update-version", function () { gulp.task("update-version", function () {
return gulp.src('./App_Data/version.template.json') return gulp.src('./App_Data/version.template.json')
.pipe(replace('{{git_ver}}', git.tag())) .pipe(replace('{{git_ver}}', git.tag()))
@ -125,7 +127,7 @@ gulp.task("update-version", function () {
.pipe(gulp.dest('./App_Data')); .pipe(gulp.dest('./App_Data'));
}); });
gulp.task("watch", function () { gulp.task("watch", function (done) {
// Watch Source Files // Watch Source Files
assets.forEach(function (src) { assets.forEach(function (src) {
for (var key in src) { for (var key in src) {
@ -144,6 +146,8 @@ gulp.task("watch", function () {
getBundles(".css").forEach(function (bundle) { getBundles(".css").forEach(function (bundle) {
gulp.watch(bundle.inputFiles, ["min:css"]); gulp.watch(bundle.inputFiles, ["min:css"]);
}); });
done();
}); });
function getBundles(extension) { function getBundles(extension) {

3230
Teknik/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@
"eslint-plugin-react": "^7.14.3", "eslint-plugin-react": "^7.14.3",
"fancy-log": "^1.3.3", "fancy-log": "^1.3.3",
"git-rev-sync": "^1.12.0", "git-rev-sync": "^1.12.0",
"gulp": "^3.9.1", "gulp": "^4.0.2",
"gulp-concat": "^2.6.1", "gulp-concat": "^2.6.1",
"gulp-cssmin": "^0.2.0", "gulp-cssmin": "^0.2.0",
"gulp-eslint": "^5.0.0", "gulp-eslint": "^5.0.0",