cr0ybot / gulp-wp

A reusable, extendable, updatable Gulp workflow for WordPress themes & plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New partial script/style files aren't picked up during dev

cr0ybot opened this issue · comments

When running the default (dev) task, adding a new script or style that is intended to be imported/used by entrypoint script/style files does not result in that file being included in the compilation.

This is a bummer, as part of the goal for these scripts was to only compile the entrypoint with altered dependencies, but if the included dependency tree utility can't handle files added in real-time then it's not very practical.

I think I've sorted out why this is happening. We're using gulp-sass-glob to transform glob imports in the entrypoint files. This works great, except when a new partial file is added, the parent file doesn't change, and because we're also using a changed utility to only pass changed files through for compilation, the entrypoint is not re-built to include the new paths (and, conversely, if a file is removed there is an import error).

One possible way to get around this is to just recompile all files if a new file is added to the watched glob, if that is possible.