aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2018-02-09 09:16:22 +0100
committerFélix Sipma <felix.sipma@no-log.org>2018-02-09 09:16:22 +0100
commit25ede29ed4099488387102a2a3a9b782deb70ea0 (patch)
treec01766085503501dffd4fd6a0705bdb6ba148999
parent090a5f19411c0762ec85c18cbc8f348009fcb29e (diff)
bundle js & css
-rw-r--r--Makefile42
1 files changed, 29 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index b60f1e9..b7b3f5c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,31 +2,47 @@ PATH := node_modules/.bin:$(PATH)
STATIC=./static
DIST_STATIC=./dist/static
+TMP=./dist/tmp
-build: npm css js fonts img site
+build: npm tmp css js fonts img site
npm:
npm install
+tmp:
+ mkdir -p $(TMP)
+
css:
- mkdir -p $(DIST_STATIC)/css && cp node_modules/bootstrap/dist/css/bootstrap.min.css $(DIST_STATIC)/css/
- cp node_modules/leaflet/dist/leaflet.css $(DIST_STATIC)/css/
- cp $(STATIC)/css/* $(DIST_STATIC)/css
+ mkdir -p $(TMP)/css/
+ mkdir -p $(DIST_STATIC)/css
+ cat \
+ node_modules/bootstrap/dist/css/bootstrap.min.css \
+ node_modules/leaflet/dist/leaflet.css \
+ node_modules/font-awesome/css/font-awesome.min.css \
+ $(STATIC)/css/* \
+ > $(TMP)/css/fournil.css
+ cp $(TMP)/css/fournil.css $(DIST_STATIC)/css
js:
- mkdir -p $(DIST_STATIC)/js && cp node_modules/leaflet/dist/leaflet.js $(DIST_STATIC)/js/
- cp node_modules/jquery/dist/jquery.min.js $(DIST_STATIC)/js/
- cp node_modules/popper.js/dist/umd/popper.min.js $(DIST_STATIC)/js/
- cp node_modules/bootstrap/js/dist/util.js $(DIST_STATIC)/js/
- cp node_modules/bootstrap/js/dist/collapse.js $(DIST_STATIC)/js/
- cp $(STATIC)/js/* $(DIST_STATIC)/js
+ mkdir -p $(TMP)/js/
+ mkdir -p $(DIST_STATIC)/js
+ cat \
+ node_modules/leaflet/dist/leaflet.js \
+ node_modules/jquery/dist/jquery.min.js \
+ node_modules/popper.js/dist/umd/popper.min.js \
+ node_modules/bootstrap/js/dist/util.js \
+ node_modules/bootstrap/js/dist/collapse.js \
+ $(STATIC)/js/* \
+ > $(TMP)/js/fournil.js
+ cp $(TMP)/js/fournil.js $(DIST_STATIC)/js
fonts:
- mkdir -p $(DIST_STATIC)/fonts && cp -R node_modules/font-awesome/fonts/* $(DIST_STATIC)/fonts/
- mkdir -p $(DIST_STATIC)/css && cp -R node_modules/font-awesome/css/font-awesome.min.css $(DIST_STATIC)/css/
+ mkdir -p $(DIST_STATIC)/fonts
+ cp -R node_modules/font-awesome/fonts/* $(DIST_STATIC)/fonts/
img:
- mkdir -p $(DIST_STATIC)/img && cp $(STATIC)/img/* $(DIST_STATIC)/img
+ mkdir -p $(DIST_STATIC)/img
+ cp $(STATIC)/img/* $(DIST_STATIC)/img
cp node_modules/leaflet/dist/images/* $(DIST_STATIC)/img
site: