var gulp = require("gulp");
var del = require("del");
var rename = require("gulp-rename");
var concat = require("gulp-concat");
var uglify = require("gulp-uglify");
var sass = require("gulp-sass")
var copyTask = async function () {
return gulp.src("./src/sample1.txt")
.pipe(gulp.dest("./dist"));
};
var delTask = async function () {
return del("./dist/*");
};
var renameTask = async function () {
gulp.src("./src/sample1.txt")
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest("./dist"));
};
var concatTask = async function () {
gulp.src(["sample1.txt", "sample2.txt"], { cwd: "./src" })
.pipe(concat("bundle.txt"))
.pipe(gulp.dest("./dist"));
};
var minifyTask = async function () {
gulp.src("./src/sample1.js")
.pipe(uglify())
.pipe(gulp.dest("./dest"));
};
var minifyTask2 = async function () {
gulp.src(["sample1.js", "sample2.js"], { cwd: "./src" })
.pipe(concat("bundle.js"))
.pipe(uglify())
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest("./dist"));
};
var sassTask = async function () {
gulp.src(["sample1.scss", "sample2.scss"], { cwd: "./src" })
.pipe(concat("bundle.scss"))
.pipe(sass({ outputStyle: "compressed" }))
.pipe(rename({suffix: ".min"}))
.pipe(gulp.dest("./dist"));
};
module.exports.default = sassTask;//minifyTask2;//concatTask;//renameTask;//delTask;//copyTask;
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme