mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
Makefile: Split run into new prebuild and run-only targets (#4450)
This provides a simple interface for build scripts that want to pre-run the webpack and ts-compile steps (e.g. when producing a container image) ahead of time rather, without requiring them to copy the current set of commands needed for each part and hope they don't change. Fixes https://github.com/compiler-explorer/compiler-explorer/issues/3287
This commit is contained in:
12
Makefile
12
Makefile
@@ -70,12 +70,20 @@ pre-commit: $(NODE_MODULES) test-min lint
|
||||
clean: ## Cleans up everything
|
||||
rm -rf node_modules .*-updated .*-bin out
|
||||
|
||||
.PHONY: run
|
||||
run: prereqs ## Runs the site like it runs in production
|
||||
.PHONY: prebuild
|
||||
prebuild: prereqs
|
||||
$(NPM) run webpack
|
||||
$(NPM) run ts-compile
|
||||
|
||||
.PHONY: run-only
|
||||
run-only: node-installed ## Runs the site like it runs in production without building it
|
||||
env NODE_ENV=production $(NODE) $(NODE_ARGS) -r esm ./out/dist/app.js --webpackContent ./out/webpack/static $(EXTRA_ARGS)
|
||||
|
||||
.PHONY: run
|
||||
run: ## Runs the site like it runs in production
|
||||
$(MAKE) prebuild
|
||||
$(MAKE) run-only
|
||||
|
||||
.PHONY: dev
|
||||
dev: prereqs ## Runs the site as a developer; including live reload support and installation of git hooks
|
||||
./node_modules/.bin/supervisor -w app.js,lib,etc/config,static/tsconfig.json -e 'js|ts|node|properties|yaml' -n exit --exec $(NODE) $(NODE_ARGS) -- -r esm -r ts-node/register ./app.js $(EXTRA_ARGS)
|
||||
|
||||
Reference in New Issue
Block a user