Skip to content

Instantly share code, notes, and snippets.

@johnkingzy
Created February 19, 2018 22:36
Show Gist options
  • Save johnkingzy/cfa6ebb454c89d7a5f41fe1563418be0 to your computer and use it in GitHub Desktop.
Save johnkingzy/cfa6ebb454c89d7a5f41fe1563418be0 to your computer and use it in GitHub Desktop.
Gulp file that copies all /dist content and cleans the laravel public folder
// tasks operations - begin
var files = [
"./../server/public/*",
"!./../server/public/.htaccess",
"!./../server/public/index.php",
"!./../server/public/storage",
"!./../server/public/favicon.ico"
];
// remove old dist folder content from the laravel public folder
gulp.src(files, { read: false }).pipe(clean({ force: true }));
//copy newly generated dist folder contents into the laravel public folder
gulp
.src(["./dist/**/*", "!./dist/index.html",
"!./dist/stats.json"])
.pipe(gulp.dest("./../server/public"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment