Allow plugins to include assets in the bundle (#28)
This commit is contained in:
parent
81c67a92f3
commit
cd8afb141d
3 changed files with 26 additions and 0 deletions
6
Makefile
6
Makefile
|
@ -4,6 +4,9 @@ NPM ?= $(shell command -v npm 2> /dev/null)
|
|||
CURL ?= $(shell command -v curl 2> /dev/null)
|
||||
MANIFEST_FILE ?= plugin.json
|
||||
|
||||
# You can include assets this directory into the bundle. This can be e.g. used to include profile pictures.
|
||||
ASSETS_DIR ?= assets
|
||||
|
||||
# Verify environment, and define PLUGIN_ID, PLUGIN_VERSION, HAS_SERVER and HAS_WEBAPP as needed.
|
||||
include build/setup.mk
|
||||
|
||||
|
@ -94,6 +97,9 @@ bundle:
|
|||
rm -rf dist/
|
||||
mkdir -p dist/$(PLUGIN_ID)
|
||||
cp $(MANIFEST_FILE) dist/$(PLUGIN_ID)/
|
||||
ifneq ($(wildcard $(ASSETS_DIR)/.),)
|
||||
cp -r $(ASSETS_DIR) dist/$(PLUGIN_ID)/
|
||||
endif
|
||||
ifneq ($(HAS_SERVER),)
|
||||
mkdir -p dist/$(PLUGIN_ID)/server/dist;
|
||||
cp -r server/dist/* dist/$(PLUGIN_ID)/server/dist/;
|
||||
|
|
Reference in a new issue