diff --git a/gulpfile.js b/gulpfile.js index 88e8ce9..b6f3fed 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,6 @@ // Gulp configuration and tasks // Imports -import babel from 'gulp-babel'; import cssNano from 'cssnano'; import gap from 'gulp-append-prepend'; import gulp from 'gulp'; @@ -10,10 +9,6 @@ import postCss from 'gulp-postcss'; import rename from 'gulp-rename'; import size from 'gulp-size'; -// Setup -const transpileES6 = ['@babel/env', { modules: false }]; -const babelMinifyJs = { presets: [transpileES6, 'minify'], comments: false }; - // Tasks const task = { @@ -29,17 +24,7 @@ const task = { .pipe(gulp.dest('build')); }, - minifyJs() { - return gulp.src('src/hamburger-menu.js') - .pipe(babel(babelMinifyJs)) - .pipe(rename({ extname: '.min.js' })) - .pipe(gap.appendText('\n')) - .pipe(size({ showFiles: true })) - .pipe(gulp.dest('build')); - }, - }; // Gulp gulp.task('minify-css', task.minifyCss); -gulp.task('minify-js', task.minifyJs); diff --git a/package.json b/package.json index 0e789ea..87e99b7 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "step:02": "jshint . --exclude-path .gitignore", "step:05": "gulp minify-css", "step:06": "copy-folder src --ext=.js build", - "step:07": "gulp minify-js", + "step:07": "uglifyjs src/hamburger-menu.js --output build/hamburger-menu.min.js", "step:08": "add-dist-header build dist --delimiter=☰", "step:09": "copy-file dist/hamburger-menu.css --folder docs", "step:10": "copy-file dist/hamburger-menu.js --folder docs", @@ -58,8 +58,6 @@ "jquery": "~3.6" }, "devDependencies": { - "@babel/core": "~7.19", - "@babel/preset-env": "~7.19", "@fortawesome/fontawesome-free": "~6.2", "add-dist-header": "~0.3", "assert-deep-strict-equal": "~1.0", @@ -81,6 +79,7 @@ "npm-run-all2": "~6.0", "postcss": "~8.4", "rimraf": "~3.0", + "uglify-js": "~3.17", "w3c-html-validator": "~1.1", "web-ignition": "~1.5" }