Phong Duong


Copy files to a new folder with Gulpjs

28-09-2020 | #gulpjs

Gulpjs provides functions that you can use to copy files from src to dist directory for production. We will create a task to copy all PNG images to the output directory.

const { src, dest } = require("gulp");

const copyPNG = () => {
  return src("src/image/*.png").pipe(dest("dist/image"));

exports.default = copyPNG;

Run gulp command


You can see your PNG images is in the dist/image directory now

Share: TwitterFacebookLinkedInHacker News