Skip to content

Commit

Permalink
feat: gulp security
Browse files Browse the repository at this point in the history
-Add Obfuscation
  • Loading branch information
MarkLovesCoding committed Feb 22, 2024
1 parent af765b7 commit 440b43a
Show file tree
Hide file tree
Showing 3 changed files with 797 additions and 62 deletions.
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const uglify = require("gulp-uglify");
const cleanCSS = require("gulp-clean-css");
const ts = require("gulp-typescript");
const tsProject = ts.createProject("tsconfig.json");
const javascriptObfuscator = require("gulp-javascript-obfuscator");
require("dotenv").config({ path: "./.env" });

// Define environment variable to differentiate between development and production
Expand Down Expand Up @@ -100,7 +101,12 @@ gulp.task("minify-css", function () {

// Task to minify JavaScript
gulp.task("minify-js", function () {
return gulp.src("dist/js/**/*.js").pipe(uglify()).pipe(gulp.dest("dist/js"));
return gulp
.src("dist/js/**/*.js")
.pipe(javascriptObfuscator())
.pipe(gulp.dest("dist/js"));

// return gulp.src("dist/js/**/*.js").pipe(uglify()).pipe(gulp.dest("dist/js"));
});

// Define the default task based on the environment
Expand Down
Loading

0 comments on commit 440b43a

Please sign in to comment.