Skip to content

Commit

Permalink
Fix platformio build, add pre-build hook to build the web app
Browse files Browse the repository at this point in the history
  • Loading branch information
LightJockey committed Jan 22, 2024
1 parent a6eabbb commit 86c2c4f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 13 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:EspDmxNode]
[platformio]
default_envs = esp8266-nodemcuv2

[common]
lib_deps =
me-no-dev/ESP Async WebServer@^1.2.3
bblanchon/ArduinoJson@^6.18.5
marvinroger/AsyncMqttClient@^0.9.0

[env:esp8266-nodemcuv2]
platform = [email protected]
framework = arduino
board = nodemcuv2
Expand All @@ -17,7 +26,7 @@ build_flags = -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED
monitor_speed = 115200
upload_speed = 115200
lib_deps =
${common.lib_deps}
me-no-dev/ESPAsyncTCP@^1.2.2
me-no-dev/ESP Async WebServer@^1.2.3
bblanchon/ArduinoJson@^6.18.5
marvinroger/AsyncMqttClient@^0.9.0
Makuna/[email protected] ; ^2.6.5 breaks compatibility
extra_scripts = pre:src/build_web_app.py
6 changes: 6 additions & 0 deletions src/build_web_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Import("env")

def build_web_app(source, target, env):
env.Execute("cd src/web_app && npm run build")

env.AddPreAction("${BUILD_DIR}/src/EspDmxNode.cpp.o", build_web_app)

0 comments on commit 86c2c4f

Please sign in to comment.