diff --git a/CMakeLists.txt b/CMakeLists.txt index e10aa9c..f19a519 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,9 +71,12 @@ if(ECHOION_BUILD_WEB) # Rebuild web-dist whenever any source/config under frontend/ (excluding # node_modules and the output dir) changes. CONFIGURE_DEPENDS re-globs at # build time so new files are picked up without re-running CMake. - file(GLOB_RECURSE _web_srcs CONFIGURE_DEPENDS + file(GLOB_RECURSE _web_tree_srcs CONFIGURE_DEPENDS + LIST_DIRECTORIES FALSE "${_web_frontend}/src/*" - "${_web_frontend}/public/*" + "${_web_frontend}/public/*") + set(_web_srcs + ${_web_tree_srcs} "${_web_frontend}/index.html" "${_web_frontend}/package.json" "${_web_frontend}/package-lock.json" @@ -82,8 +85,9 @@ if(ECHOION_BUILD_WEB) add_custom_command( OUTPUT "${_web_dist}/index.html" - # `npm ci` when the lockfile is newer than node_modules keeps installs - # reproducible; the stamp check avoids reinstalling on every build. + # Release builds run `npm ci` before CMake. This lockfile-aware fallback + # keeps direct developer builds convenient without reinstalling on every + # incremental build. COMMAND ${NPM_EXECUTABLE} install --prefer-offline --no-audit --no-fund COMMAND ${NPM_EXECUTABLE} run build WORKING_DIRECTORY "${_web_frontend}"