mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-17 11:37:10 +03:00
chore: add an ption to turn off TSC check step
This also speeds up the recompilation times, since TSC is now used only if the output is missing or the typescript files are changed.
This commit is contained in:
parent
3154606047
commit
54eec739dc
@ -5,6 +5,15 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(bismuth)
|
||||
|
||||
option(
|
||||
USE_TSC
|
||||
"Use TypeScript Compler to check the code before bundling \
|
||||
using esbuild. This could be useful, if you know, that the \
|
||||
code is correct and you want to speed up building times. \
|
||||
For example - you are a packager."
|
||||
ON
|
||||
)
|
||||
|
||||
set(QT_MIN_VERSION "5.15.0")
|
||||
set(KF5_MIN_VERSION "5.80.0")
|
||||
|
||||
|
@ -23,24 +23,20 @@ add_custom_target(
|
||||
|
||||
file(GLOB_RECURSE TYPESCRIPT_SOURCES CONFIGURE_DEPENDS "*.ts")
|
||||
|
||||
if(USE_TSC)
|
||||
set(TSC_COMMAND "npx" "tsc" "--noEmit" "--incremental")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "bismuth/contents/code/index.mjs"
|
||||
COMMAND ${TSC_COMMAND}
|
||||
COMMAND "npx" "esbuild"
|
||||
"--bundle" "${CMAKE_CURRENT_SOURCE_DIR}/index.ts"
|
||||
"--outfile=${CMAKE_CURRENT_BINARY_DIR}/bismuth/contents/code/index.mjs"
|
||||
"--format=esm"
|
||||
"--platform=neutral"
|
||||
DEPENDS
|
||||
LintViaTSC
|
||||
${TYPESCRIPT_SOURCES}
|
||||
COMMENT "🎁 Bundling using esbuild..."
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
LintViaTSC
|
||||
COMMAND "npx" "tsc" "--noEmit" "--incremental"
|
||||
COMMENT "👮 Checking sources using TS Compiler..."
|
||||
DEPENDS ${TYPESCRIPT_SOURCES}
|
||||
COMMENT "🏗️ Compiling and bundling TypeScirpt sources..."
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
|
Loading…
Reference in New Issue
Block a user