Sub-dependencies of the mixin files are not passed to the build tools like webpack (via helpers.result.messages)
1:
According to this line:
mixins[name] = { mixin: require(path), file: path }
Function mixins are loaded using node require function. In development mode, this code might be called several times when the source code of function mixin is changed.
But after the first load, required files will not be updated because of the require caching.
One solution would be to clear cached modules. Like this:
Another, "in-place", solution would be to create a custom postcss plugin that will do these steps after the main plugin as it is. But this solution looks like a hack.
There are 2 issues:
require
callshelpers.result.messages
)1: According to this line:
mixins[name] = { mixin: require(path), file: path }
Function mixins are loaded using noderequire
function. In development mode, this code might be called several times when the source code of function mixin is changed. But after the first load, required files will not be updated because of the require caching.One solution would be to clear cached modules. Like this:
But if we take into the account the case when mixin has its own dependencies, we have to clear the cache for them too:
2: To fix the second issue, we just have to add each child dependency to the watch list alongside with clearing the cache. Something like this:
Another, "in-place", solution would be to create a custom postcss plugin that will do these steps after the main plugin as it is. But this solution looks like a hack.
I can create a PR with these changes.