WEBPACK_CONFIG_PATH=webpack.config.js ### @usage: TS_WEBPACK_CONFIG(ConfigPath) ### ### Macro sets the config path for TS_WEBPACK module. ### ### - ConfigPath - config path ### ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_WEBPACK#ts-webpack-config macro TS_WEBPACK_CONFIG(ConfigPath) { SET(WEBPACK_CONFIG_PATH $ConfigPath) } WEBPACK_OUTPUT_DIR=bundle ### @usage: TS_WEBPACK_OUTPUT(FirstDirName DirNames) ### ### Macro sets the output directory names (one at least) for TS_WEBPACK module. ### ### - DirNames - output directory names (one at least) ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_WEBPACK#ts-webpack-output macro TS_WEBPACK_OUTPUT(FirstDirName, DirNames...) { SET(WEBPACK_OUTPUT_DIR $FirstDirName $DirNames) } # TODO: remove me: https://st.yandex-team.ru/FBP-1678 # tag:deprecated macro WEBPACK_OUTPUT(FirstDirName, DirNames...) { MESSAGE(WARNING "WEBPACK_OUTPUT is deprecated, use TS_WEBPACK_OUTPUT instead") SET(WEBPACK_OUTPUT_DIR $FirstDirName $DirNames) } TS_WEBPACK_CMD=$TOUCH_UNIT \ && $_TS_FILES_COPY_CMD \ && $ADD_VCS_INFO_FILE_CMD \ && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS build-webpack $NOTS_TOOL_COMMON_BUILDER_ARGS \ --bundler-config-path ${input:WEBPACK_CONFIG_PATH} \ --output-dirs ${WEBPACK_OUTPUT_DIR} \ $_NODE_MODULES_INOUTS ${hide:PEERS} \ ${input;hide:"package.json"} ${TS_CONFIG_FILES} $_AS_HIDDEN_INPUTS(IN $TS_INPUT_FILES) \ ${output;hide:"package.json"} \ ${kv;hide:"pc magenta"} ${kv;hide:"p TS_WPK"} ### @usage: TS_WEBPACK([name]) ### ### The Webpack bundle, bundles JavaScript code. ### Build results are packed as `output.tar`. ### ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_WEBPACK ### ### @example ### ### TS_WEBPACK() ### END() ### multimodule TS_WEBPACK { module BUILD: _TS_BASE_UNIT { .CMD=TS_WEBPACK_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(webpack webpack-cli) 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 { } }