Corrects the relative path error for the Gulp watch task.
npm:
$ npm install --save-dev gulp-filterpath
yarn:
yarn add -D gulp-filterpath
const path = require("path");
const filterPath = require("gulp-filterpath");
const config = {
src: "./theme/src",
dist: "./theme/assets",
};
const correct_path = filterPath(__dirname, path.resolve(config.src, "js/**/*.js"));
root_path
- The project root path.target_path
- Full path to files.