Gulp not copying files with simple task
See original GitHub issueI am trying to copy an HTML page from my ‘src’ folder to my ‘dist’ folder but it’s not working and I can figure out why. I’ve tried looking online and all the snippets of code I found are doing exactly the same, except it’s not copying anything in my case.
my project’s folder structure:
Test
|
|-- dist
|-- node_modules
|-- src
|-- index.html
My Gulpfile
'use strict'
var gulp = require('gulp');
gulp.task('copy', function () {
return gulp.src('./src/index.html')
.pipe(gulp.dest('./dist/'));
});
I’ve tried removing the “return” , trying using glob (./src/**/.html, src/.html), I’ve tried using base: ‘src’ and ‘test’… Nothing works and it’s driving me nuts. Any ideas?
Npm and Gulp versions
npm: 5.6.0
gulp: 3.9.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Gulp doesn't copy all files as expected - Stack Overflow
SOLVED IT MYSELF! The problem was caused by async operating tasks. Adding a return forced gulp to complete the copying process before continuing!...
Read more >Copying files with Gulp doesn't work - JavaScript - SitePoint
In my Gulp file that I'm using to customize Bootstrap, I have a segment that simply copies over a few Bootstrap .js files...
Read more >Simple Gulp Copy file task (Example) - Coderwall
This is just a handy way of copying a file from one folder to another. There is no goal of replacing other tools...
Read more >Build and run your project - Write JavaScript for the Web
Let's now build a simple task which takes all HTML files in our project directory and copies them to a dist folder.
Read more >Getting Started with Gulp.js - Semaphore Tutorial
We will create a simple task to get familiar with basic methods. To copy files, we only need to use the src and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was running
node gulpfile.js
instead ofgulp
Newbie to gulp 😄Closing due to inactivity.