gulp serve-docs does not copy 'dist' to docs/out
Unlike #177. In my environment, gulp build-docs creates both ../docs/out/src/ and ../docs/out/dist/. I can docpad run perfectly, and also am running gulp watch inside ui/. The problem is with gulp serve-docs when changing ui/src/ files:
- Change src file (in
site/usually) gulp watchdetect the changes and rebuildsdist/.gulp serve-docsdetect the changes and copy changed files to../docs/out/src/(at this point, only the ones insidesrc/of course)gulp watchends rebuilding. The problem (ISSUE HERE) isgulp serve-docsdoes not copy any change indist/so../docs/out/dist/never gets updated automatically.
Naturally, docpad never gets to serve the updated dist files.
I end with one of two options:
a) gulp build-docs after gulp watch ends rebuilding.
b) Copy, paste and replace the contents of dist/ into ../docs/out/dist after every rebuilding.
See https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/docs/serve.js#L138 Not sure why the lines are commented out.
I've faced the same issue, in my case the issue was solved by commenting part of isConfig condition in https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/docs/serve.js#L132
After modification it looks like this:
isConfig = (file.path.indexOf('theme.config') !== -1/* || file.path.indexOf('site.variables') !== -1*/);
More details:
Modifying site/globals/site.variables makes isConfig flag to be true, that seems to be not good.
So that code:
if(isConfig) {
// console.info('Rebuilding all files');
// cant rebuild paths are wrong
// gulp.start('build-docs');
return;
}
is executed, and its doing nothing, that is problem itself.
What we want is condition below to be executed:
else if(isSiteTheme) {
console.log('Change detected in site theme');
lessPath = util.replaceExtension(file.path, '.less');
lessPath = lessPath.replace(source.site, source.definitions);
}
So, commenting-out part of condition for isConfig did the trick.
I hope you guys can solve this issue soon 🙂