This project is the sample demo project that illustrate how to use Gulp to copy the files from React build folder to the own defined folder structure and rename files to remove the hash.
In the project directory, you can run:
This will install all the required packages.
This will build React app and will add files in the build
folder
Need to install gulp and other supporting packages,
Install gulp
npm install --save-dev gulp
Install gulp-if
npm install gulp-if
Install gulp-rename
npm install gulp-rename
Update the gulpfile.js to set the folder structure where the React build js and css files will ge copied.
/** JSON object to define build path and source path. Change according to the project folder structure */
var path = {
devbuild: "build", // name of the React Build folder.
dist: { js: "dist/scripts", css: "dist/styles" }, // name of the dist folder
};
Run gulp build