Add debug-dist and debug-deploy build targets (#61)

* Add debug-dist and debug-deploy build targets

* Fix typos in documentation for new targets

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>
This commit is contained in:
Ian Whitlock 2019-08-28 08:53:16 -05:00 committed by Christopher Poile
parent 90c0d4e853
commit 49e8d0b875
3 changed files with 18 additions and 1 deletions

View file

@ -17,7 +17,7 @@ include build/setup.mk
BUNDLE_NAME ?= $(PLUGIN_ID)-$(PLUGIN_VERSION).tar.gz
# Include custom makefile, if pressent
# Include custom makefile, if present
ifneq ($(wildcard build/custom.mk),)
include build/custom.mk
endif
@ -103,6 +103,13 @@ ifneq ($(HAS_WEBAPP),)
cd webapp && $(NPM) run build;
endif
## Builds the webapp in debug mode, if it exists.
webapp-debug: webapp/.npminstall
ifneq ($(HAS_WEBAPP),)
cd webapp && \
$(NPM) run debug;
endif
## Generates a tar bundle of the plugin for install.
.PHONY: bundle
bundle:
@ -150,6 +157,12 @@ else
@echo "No supported deployment method available. Install plugin manually."
endif
.PHONY: debug-deploy
debug-deploy: debug-dist deploy
.PHONY: debug-dist
debug-dist: apply server webapp-debug bundle
## Runs any lints and unit tests defined for the server and webapp, if they exist.
.PHONY: test
test: webapp/.npminstall

View file

@ -71,3 +71,6 @@ if appErr := p.API.SetProfileImage(userID, profileImage); appErr != nil {
return errors.Wrap(err, "failed to set profile image")
}
```
### How do I build the plugin with unminified JavaScript?
Use `make debug-dist` and `make debug-deploy` in place of `make dist` and `make deploy` to configure webpack to generate unminified Javascript.

View file

@ -5,6 +5,7 @@
"main": "src/index.js",
"scripts": {
"build": "webpack --mode=production",
"debug": "webpack --mode=none",
"lint": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx . --quiet",
"fix": "eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx . --quiet --fix",
"test": "jest --forceExit --detectOpenHandles --verbose"