X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2FMakefile;h=c5d5d62b99233c700b359fe04d129d1968245362;hb=85545aba62546f219a9c9730945511412a3174ef;hp=1d980854639fc27a19a258315940ce693671d6fb;hpb=7a9e5112eaaea58d55f181d3e5296e4ff839921c;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/Makefile b/cmd/web/Makefile index 1d98085..c5d5d62 100644 --- a/cmd/web/Makefile +++ b/cmd/web/Makefile @@ -4,49 +4,58 @@ export PATH := $(PATH):./node_modules/.bin SRC_DIR=js BUILD_DIR=build/js -JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx +JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx password_reset.jsx change_password.jsx JS_SRC= cookies.js app.js api.js +STATIC_FILES= index.html style.css JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) +ICONS=$(addprefix $(STATIC_BUILD_DIR)/icons/black/, $(notdir $(wildcard static/icons/black/*.svg))) +ICONS+=$(addprefix $(STATIC_BUILD_DIR)/icons/color/, $(notdir $(wildcard static/icons/color/*.svg))) STATIC_BUILD_DIR=build/static +$(info $(ICONS)) + install: node --version npm --version yarn --version yarn install -static: js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css +static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) $(ICONS) js: build/static/main.js -$(STATIC_BUILD_DIR)/index.html: static/index.html - cp static/index.html $@ +$(STATIC_BUILD_DIR)/%: static/% + cp $< $@ -$(STATIC_BUILD_DIR)/style.css: static/style.css - cp static/style.css $@ +$(STATIC_BUILD_DIR): + mkdir -p $(BUILD_DIR) + mkdir -p $@ + mkdir -p $@/icons/black + mkdir -p $@/icons/color $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx - mkdir -p $(@D) - jscs --fix $< - babel $< -o $@ - jshint $@ + eslint --fix $< + cp $< $@ $(BUILD_DIR)/%.js: $(SRC_DIR)/%.js - jscs --fix $< + eslint $< + cp $< $@ + +$(STATIC_BUILD_DIR)/icons/black/%.svg: static/icons/black/%.svg cp $< $@ - jshint $@ build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env - browserify -t [ localenvify --envfile env/$(ENV).env ] \ - -t [ debowerify ] \ - $(BUILD_DIR)/main.js -o $@ + browserify -t [ babelify --presets [ env react ] --plugins [ transform-class-properties ] ] \ + -t [ localenvify --envfile env/$(ENV).env ] \ + -t [ debowerify ] \ + $(BUILD_DIR)/main.js -o $@ -build/webapp.tar.gz: $(STATIC_BUILD_DIR)/main.js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css - tar czf $@ --directory=$(dir $<) $(notdir $^) +build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js $(ICONS) + tar czf $@ --directory=$(dir $<) $(subst $(STATIC_BUILD_DIR)/,,$^) -release: build/webapp.tar.gz +release: $(STATIC_BUILD_DIR) build/webapp.tar.gz clean: rm -rf build - rm -rf node_modules \ No newline at end of file + rm -rf node_modules