caktus / django-project-template

Django project template for startproject (Requires 2.2+)
211 stars 53 forks source link

Touch output of gulp compiles to update modtime #300

Closed dpoirier closed 4 years ago

dpoirier commented 4 years ago

Gulp is setting the modtime on bundle.css to the modtime of index.less, even if other .less files that it includes are newer. And collectstatic only copies files if the source file's modtime is newer than an existing target file's modtime. So, Gulp might be recompiling the styles, but collectstatic won't copy them because they don't look newer than what's already there.

To fix this, the gulpfile is modified to set the modtime of the result of each compilation to the current time.
dpoirier commented 4 years ago

I was thinking it didn't actually write the results to a file in the case of "npm run dev", but I can double-check that, maybe that's more of a Vue thing.

dpoirier commented 4 years ago

@dchukhin I did some testing and the touch() function we're using will not create a file if it doesn't exist, which was what I was worried about, so I updated the PR to just always call touch() to simplify things.