aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile44
-rw-r--r--webpack.config.js2
3 files changed, 46 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 0eb7349..aab868c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ database/*
fonts/*
media/*
render/
+dist/
vendor/*
node_modules/*
config.json
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8978954
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+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)
+
+release: clean $(zip_release)
+
+dist/wcms-%.zip: php_dependencies $(js_bundles)
+ @echo "Building Zip release..."
+ mkdir -p $(dir $@)
+ zip -r $@ \
+ app \
+ assets \
+ vendor \
+ .htaccess \
+ index.php \
+ LICENSE.md \
+ README.md \
+ -x "*test*" \
+ -x "*docs*"
+
+assets/js/%.bundle.js: src/%.js js_dependencies
+ @echo "Building JS Bundles..."
+ mkdir -p $(dir $@)
+ npm run build
+
+php_dependencies:
+ @echo "Installing PHP dependencies..."
+ composer install --no-dev --prefer-dist
+
+php_clean:
+ @echo "Cleaning PHP..."
+ rm -rf vendor
+
+js_dependencies:
+ @echo "Installing JS dependencies..."
+ npm install
+
+js_clean:
+ @echo "Cleaning JS..."
+ rm -rf node_modules
+
+clean: php_clean js_clean
diff --git a/webpack.config.js b/webpack.config.js
index e18b201..c952669 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -27,4 +27,4 @@ module.exports = (env) => {
],
},
}
-}; \ No newline at end of file
+};