Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] "gulp serve-docs" do not update semantic(.min).css in docs/out #189

Open
exoego opened this issue Dec 22, 2019 · 1 comment
Open

Comments

@exoego
Copy link
Contributor

exoego commented Dec 22, 2019

Bug Report

Steps to reproduce

Assuming the following directory

  • fomantic/
    • ui
    • docs
  1. Run docpad run --port 8080 in docs
  2. Run gulp serve-docs in ui
  3. Edit input.less in ui
  4. Open http://localhost:8080/elements/input.html

Expected result

Styles in http://localhost:8080/elements/input.html get updated as edited.

Actual result

Styles not get updated.

Logs on terminal.

$ gulp serve-docs
Change detected in definition
[11:45:00] Created: ../docs/out/src/definitions/elements/input.less
[11:45:01] Starting '<anonymous>'...
[11:45:01] Starting 'Building uncompressed CSS'...
[11:45:01] Starting 'Building compressed CSS'...
[11:45:03] Created: dist/components/input.css
[11:45:03] Finished 'Building uncompressed CSS' after 1.56 s
[11:45:03] Starting 'Packing uncompressed CSS'...
[11:45:03] Created: dist/components/input.min.css
[11:45:03] Finished 'Building compressed CSS' after 1.57 s
[11:45:03] Starting 'Packing compressed CSS'...
[11:45:17] Created: ../docs/out/dist/semantic.css
[11:45:17] Finished 'Packing uncompressed CSS' after 14 s
[11:45:17] Created: ../docs/out/dist/semantic.min.css
[11:45:17] Finished 'Packing compressed CSS' after 14 s
[11:45:17] Finished '<anonymous>' after 16 s

From the above log, I assume ../docs/out/dist/semantic.css get updated, but not include changes.

Version

2.8.2

@lubber-de lubber-de transferred this issue from fomantic/Fomantic-UI Dec 22, 2019
@Shriken
Copy link

Shriken commented Dec 1, 2020

After some debugging I found out that CSS task watch configuration is a bit off.

In tasks/build/css.js file:

function docs(src, callback) {
  if (callback === undefined) {
    callback = src;
    src      = config.paths.source.definitions + '/**/' + config.globs.components + '.less';
  }

  const func       = (callback) => buildCSS(src, 'docs', config, {}, callback);
  func.displayName = "CSS Docs";

  func(callback);
}

It seems like the the buildCSS function call should use argument 'docsConfig' instead of 'config'
This will generate the new compiled css files to 'docs/out/dist/components' and next gulp piping will generate your final compressed min.css file correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants