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

Use npm to manage fomantic and only build needed components #9561

Merged
merged 14 commits into from
Jan 21, 2020
Prev Previous commit
Next Next commit
Simplife the makefile
  • Loading branch information
lunny committed Jan 20, 2020
commit b3013b14709d15ae71e54f7a53ff92604dd9c3fb
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -480,18 +480,10 @@ $(JS_DEST): node_modules $(JS_SOURCES)
npx webpack

.PHONY: fomantic
fomantic: $(FOMANTIC_DEST_DIR)
node_modules/fomantic-ui/src: node-check node_modules

# TODO(das7pad): replace with resolve.alias when building fomantic with webpack
node_modules/fomantic-ui/src/theme.config: node_modules/fomantic-ui/src
node_modules/fomantic-ui/src/theme.config: web_src/fomantic/theme.config.less
ifeq (,$(wildcard $@))
cp $< $@
endif
fomantic: node-check $(FOMANTIC_DEST_DIR)

$(FOMANTIC_DEST_DIR): node_modules/fomantic-ui/src
$(FOMANTIC_DEST_DIR): node_modules/fomantic-ui/src/theme.config
$(FOMANTIC_DEST_DIR): node_modules semantic.json web_src/fomantic/theme.config.less
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
npx gulp -f node_modules/fomantic-ui/gulpfile.js build

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is possible to have this as a non-phony target that depends on package-lock.json, so it would only run if dependencies change.

Copy link
Member

@silverwind silverwind Jan 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I'd suggest the target to be adjusted to provide one or more output files, like public/fomantic/semantic.min.js and public/fomantic/semantic.min.css. We can still have a phony fomantic target that depends on that file to trigger it on-demand.

.PHONY: css
Expand Down