blob: e03739fbb04996383ed0af2fd2852804d7339b9c (
plain) (
tree)
|
|
VITE_CONFIG_PATH=vite.config.ts
### @usage: TS_VITE_CONFIG(ConfigPath)
###
### Macro sets the config path for TS_VITE module.
###
### - ConfigPath - config path
###
### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_VITE#ts-vite-config
macro TS_VITE_CONFIG(ConfigPath) {
SET(VITE_CONFIG_PATH $ConfigPath)
}
VITE_OUTPUT_DIR=dist
### @usage: TS_VITE_OUTPUT(DirName)
###
### Macro sets the output directory name for TS_VITE module.
###
### - DirName - output directory name
###
### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_VITE#ts-vite-output
macro TS_VITE_OUTPUT(DirName) {
SET(VITE_OUTPUT_DIR $DirName)
}
# TODO: remove me: https://st.yandex-team.ru/FBP-1678
# tag:deprecated
macro VITE_OUTPUT(DirName) {
MESSAGE(WARNING "VITE_OUTPUT is deprecated, use TS_VITE_OUTPUT instead")
SET(VITE_OUTPUT_DIR $DirName)
}
TS_VITE_CMD=$_TS_FILES_COPY_CMD \
&& $ADD_VCS_INFO_FILE_CMD \
&& $NOTS_TOOL $NOTS_TOOL_BASE_ARGS build-vite $NOTS_TOOL_COMMON_BUILDER_ARGS \
--bundler-config-path ${input:VITE_CONFIG_PATH} \
--output-dirs ${VITE_OUTPUT_DIR} \
$_NODE_MODULES_INOUTS ${hide:PEERS} \
${hide;input:"package.json"} ${TS_CONFIG_FILES} $_AS_HIDDEN_INPUTS(IN $TS_INPUT_FILES) \
${hide;output:"package.json"} \
${hide;kv:"pc magenta"} ${hide;kv:"p TS_VIT"}
### @usage: TS_VITE([name])
###
### The Vite bundle, bundles JavaScript code.
### Build results are packed as `<module_name>.output.tar`.
###
### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_VITE
###
### @example
###
### TS_VITE()
### END()
###
multimodule TS_VITE {
module BUILD: _TS_BASE_UNIT {
.CMD=TS_VITE_CMD
.EPILOGUE=_TS_CONFIG_EPILOGUE
.PEERDIRSELF=TS_PREPARE_DEPS
# by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
# but we have to set it to TS for include processor to work
SET(MODULE_TAG TS)
SET(MODULE_LANG TS)
_PEERDIR_TS_RESOURCE(vite)
DISABLE(TS_CONFIG_DEDUCE_OUT)
DISABLE(TS_CONFIG_USE_OUTDIR)
_TS_CONFIGURE()
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
_TS_ADD_NODE_MODULES_FOR_BUILDER()
}
module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
}
}
|