Compress css with nodejs (#2580)
This commit is contained in:
parent
fa6d7c7b99
commit
086eb62691
14
Makefile
14
Makefile
|
@ -289,21 +289,17 @@ public/js/index.js: $(JAVASCRIPTS)
|
||||||
cat $< >| $@
|
cat $< >| $@
|
||||||
|
|
||||||
.PHONY: stylesheets-check
|
.PHONY: stylesheets-check
|
||||||
stylesheets-check: stylesheets
|
stylesheets-check: generate-stylesheets
|
||||||
@diff=$$(git diff public/css/index.css); \
|
@diff=$$(git diff public/css/index.css); \
|
||||||
if [ -n "$$diff" ]; then \
|
if [ -n "$$diff" ]; then \
|
||||||
echo "Please run 'make stylesheets' and commit the result:"; \
|
echo "Please run 'make generate-stylesheets' and commit the result:"; \
|
||||||
echo "$${diff}"; \
|
echo "$${diff}"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
.PHONY: stylesheets
|
.PHONY: generate-stylesheets
|
||||||
stylesheets:
|
generate-stylesheets:
|
||||||
@hash minify > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
node_modules/.bin/lessc --no-ie-compat --clean-css public/less/index.less public/css/index.css
|
||||||
$(GO) get -u github.com/tdewolff/minify/cmd/minify; \
|
|
||||||
fi
|
|
||||||
node_modules/.bin/lessc --no-ie-compat public/less/index.less public/css/index.css
|
|
||||||
minify -o public/css/index.css public/css/index.css
|
|
||||||
|
|
||||||
.PHONY: swagger-ui
|
.PHONY: swagger-ui
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
|
|
11
package.json
11
package.json
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
"less": "^2.7.2"
|
"less": "^2.7.2",
|
||||||
}
|
"less-plugin-clean-css": "^1.5.1"
|
||||||
}
|
}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue