Semantic-UI-Docs icon indicating copy to clipboard operation
Semantic-UI-Docs copied to clipboard

gulp serve-docs does not copy 'dist' to docs/out

Open nyrdz opened this issue 9 years ago • 2 comments

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:

  1. Change src file (in site/ usually)
  2. gulp watch detect the changes and rebuilds dist/. gulp serve-docs detect the changes and copy changed files to ../docs/out/src/ (at this point, only the ones inside src/ of course)
  3. gulp watch ends rebuilding. The problem (ISSUE HERE) is gulp serve-docs does not copy any change in dist/ 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.

nyrdz avatar Sep 30 '16 22:09 nyrdz

See https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/docs/serve.js#L138 Not sure why the lines are commented out.

fvanwijk avatar Oct 04 '16 09:10 fvanwijk

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 🙂

omieliekh avatar Mar 10 '17 13:03 omieliekh