gluon-web-osm: add minify flag support

This commit is contained in:
Jan-Niklas Burfeind 2023-01-02 15:43:12 +01:00
parent 389314f58a
commit 0ec3207830
4 changed files with 15 additions and 2 deletions

View File

@ -13,7 +13,7 @@ define Package/gluon-config-mode-geo-location-osm/install
$(Gluon/Build/Install) $(Gluon/Build/Install)
$(INSTALL_DIR) $(1)/lib/gluon/config-mode/www/static/ $(INSTALL_DIR) $(1)/lib/gluon/config-mode/www/static/
$(LN) /lib/gluon/web/www/static/gluon-web-osm.min.js $(1)/lib/gluon/config-mode/www/static/gluon-web-osm.js $(LN) /lib/gluon/web/www/static/gluon-web-osm.js $(1)/lib/gluon/config-mode/www/static/
endef endef
$(eval $(call BuildPackageGluon,gluon-config-mode-geo-location-osm)) $(eval $(call BuildPackageGluon,gluon-config-mode-geo-location-osm))

View File

@ -8,4 +8,17 @@ define Package/gluon-web-osm
TITLE:=base src for OSM inlay TITLE:=base src for OSM inlay
endef endef
PKG_CONFIG_DEPENDS += CONFIG_GLUON_MINIFY
define Package/gluon-web-osm/install
$(Gluon/Build/Install)
$(INSTALL_DIR) $(1)/lib/gluon/web/www/static/
ifdef CONFIG_GLUON_MINIFY
$(INSTALL_DATA) ./javascript/gluon-web-osm.min.js $(1)/lib/gluon/web/www/static/gluon-web-osm.js
else
$(INSTALL_DATA) ./javascript/gluon-web-osm.js $(1)/lib/gluon/web/www/static/
endif
endef
$(eval $(call BuildPackageGluon,gluon-web-osm)) $(eval $(call BuildPackageGluon,gluon-web-osm))

View File

@ -1,7 +1,7 @@
/* /*
Build using: Build using:
uglifyjs javascript/gluon-web-osm.js -o files/lib/gluon/web/www/static/gluon-web-osm.min.js -c -m uglifyjs javascript/gluon-web-osm.js -o javascript/gluon-web-osm.min.js -c -m
*/ */
'use strict'; 'use strict';