MM-14575: Automatically serve static files for plugins (#33)

* MM-14575: Automatically serve static files for plugins
* Added sample public file
* Added HAS_PUBLIC to Makefile to test for public folder
* Added "static_files" config setting

* MM-14575: Removing static_files from plugin.json

* MM14575: Moving public folder to bundle root

* MM14575:Moving public directory to root
This commit is contained in:
happygaijin 2019-04-02 13:22:01 -07:00 committed by Lev
parent 63f5322e4e
commit 0e863452cc
3 changed files with 7 additions and 0 deletions

View file

@ -100,6 +100,9 @@ bundle:
ifneq ($(wildcard $(ASSETS_DIR)/.),)
cp -r $(ASSETS_DIR) dist/$(PLUGIN_ID)/
endif
ifneq ($(HAS_PUBLIC),)
cp -r public/ dist/$(PLUGIN_ID)/
endif
ifneq ($(HAS_SERVER),)
mkdir -p dist/$(PLUGIN_ID)/server/dist;
cp -r server/dist/* dist/$(PLUGIN_ID)/server/dist/;

View file

@ -25,6 +25,9 @@ HAS_SERVER ?= $(shell build/bin/manifest has_server)
# Determine if a webapp is defined in the manifest.
HAS_WEBAPP ?= $(shell build/bin/manifest has_webapp)
# Determine if a /public folder is in use
HAS_PUBLIC ?= $(wildcard public/.)
# Try looking for dep in $(GOPATH) in case $(GOPATH)/bin isn't in $(PATH).
GOPATH ?= $(shell $(GO) env GOPATH)
ifeq ($(DEP),)

1
public/hello.html Normal file
View file

@ -0,0 +1 @@
Hello from the static files public folder for the com.mattermost.sample-plugin plugin!