aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2019-10-22 16:48:55 +0200
committern-peugnet <n.peugnet@free.fr>2019-10-22 16:48:55 +0200
commit6066bc7dec3ff45be83c646be31b7eff9f7a54eb (patch)
treea11b78218a8580f4438f598d3dcb676aab96ac07
parent2ed2bc9f2ef986b150159c2245c908adfd81f606 (diff)
downloadwcms-6066bc7dec3ff45be83c646be31b7eff9f7a54eb.tar.gz
wcms-6066bc7dec3ff45be83c646be31b7eff9f7a54eb.zip
finish Makefile and update README
-rw-r--r--Makefile14
-rw-r--r--README.md4
-rw-r--r--webpack.config.js1
3 files changed, 14 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 8978954..c0840b1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,15 @@
+PATH := vendor/bin:node_modules/.bin:$(PATH)
GIT_VERSION := $(shell git --no-pager describe --always --tags)
js_sources := $(wildcard src/*.js)
-js_bundles := $(js_sources:src/%.js=assets/js/%.bundle.js)
-zip_release := $(GIT_VERSION:%=dist/wcms-%.zip)
+js_bundles := $(js_sources:src/%.js=assets/js/%.bundle.js)
+zip_release := $(GIT_VERSION:%=dist/w_cms_%.zip)
-release: clean $(zip_release)
+build: clean $(zip_release)
-dist/wcms-%.zip: php_dependencies $(js_bundles)
+install: php_dependencies $(js_bundles)
+
+dist/w_cms_%.zip: install
@echo "Building Zip release..."
mkdir -p $(dir $@)
zip -r $@ \
@@ -23,7 +26,7 @@ dist/wcms-%.zip: php_dependencies $(js_bundles)
assets/js/%.bundle.js: src/%.js js_dependencies
@echo "Building JS Bundles..."
mkdir -p $(dir $@)
- npm run build
+ webpack --env prod
php_dependencies:
@echo "Installing PHP dependencies..."
@@ -42,3 +45,4 @@ js_clean:
rm -rf node_modules
clean: php_clean js_clean
+ rm -rf dist
diff --git a/README.md b/README.md
index ff1315f..bc22fa1 100644
--- a/README.md
+++ b/README.md
@@ -77,6 +77,10 @@ While developing the JS sources it is useful to run webpack in watch mode so tha
npm run watch
+## Release zip
+
+To build the release zip, make sure you are on `master` and executed `git pull` then run `make`. This will create a zip file in `dist/`.
+
To Do
=====
diff --git a/webpack.config.js b/webpack.config.js
index c952669..734b3cd 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -5,6 +5,7 @@ module.exports = (env) => {
// Environment dependent
mode: env == 'dev' ? 'development' : 'production',
devtool: env == 'dev' ? 'inline-source-map' : 'none',
+ stats: env == 'dev' ? {} : { warnings: false },
// Constant
entry: {