This commit is contained in:
Clément
2018-10-05 11:37:48 +02:00
parent 72a47b9cb6
commit 51ccde0c0e
36 changed files with 328 additions and 369 deletions

View File

@ -1,6 +1,8 @@
DIST_DIR := www
SCRIPT_SRC := $(wildcard src/scripts/*.js)
SCRIPT_DEST := $(SCRIPT_SRC:src/%=www/%)
SCRIPT_DEST := $(SCRIPT_SRC:src/%=$(DIST_DIR)/%)
default: build
@ -14,7 +16,7 @@ submodules:
git submodule init
git submodule update
build: www/index.html www/styles/index.css $(SCRIPT_DEST)
build: $(DIST_DIR)/index.html $(DIST_DIR)/styles/index.css $(SCRIPT_DEST)
watch:
@echo 'watching for change'
@ -36,21 +38,22 @@ copy_lib:
@node copy_lib.js
# pug
www/index.html: src/index.pug $(wildcard src/*.pug src/*/*.pug)
$(DIST_DIR)/index.html: src/index.pug $(wildcard src/*.pug src/*/*.pug)
@echo pug: $< ➜ $@
@node_modules/.bin/pug --pretty $< --out $(dir $@) || touch $@
# sass
www/styles/index.css: src/styles/index.scss $(wildcard src/*.scss src/*/*.scss)
$(DIST_DIR)/styles/index.css: src/styles/index.scss $(wildcard src/*.scss src/*/*.scss)
@echo sass: $< ➜ $@
@node_modules/.bin/node-sass $< $@ --source-map true || touch $@
@node_modules/.bin/node-sass $< $@ --source-map true --source-map-contents || touch $@
# babel
www/%.js: src/%.js
$(DIST_DIR)/%.js: src/%.js
@echo babel: $< ➜ $@
@mkdir -p $(dir $@)
@node_modules/.bin/babel $< --out-file $@ --source-maps || touch $@
.PHONY: default install submodules copy_lib build watch serve clean
sync:
rsync -rv www/* staging-app@ssh-staging-app.happy-dev.fr:~/staging-app.happy-dev.fr/
.PHONY: default install submodules copy_lib build watch serve clean